Skip to content
Python

Merge branch 'main' into queue_editor

Chris Malonea50047804a78
diff --cc wgp.py
index 8d5dd9a,d483a4f..216272c
--- a/wgp.py
+++ b/wgp.py
@@@ -150,13 -149,24 +149,30 @@@ def format_time(seconds)
else:
return f"{seconds:.1f}s"
-
+def get_pastel_color(index):
+ hue = (index * 137) % 360
+ saturation = 75
+ lightness = 92
+ return f"hsl({hue}, {saturation}%, {lightness}%)"
+
+ def format_generation_time(seconds):
+ """Format generation time showing raw seconds with human-readable time in parentheses when over 60s"""
+ raw_seconds = f"{int(seconds)}s"
+
+ if seconds < 60:
+ return raw_seconds
+
+ hours = int(seconds // 3600)
+ minutes = int((seconds % 3600) // 60)
+ secs = int(seconds % 60)
+
+ if hours > 0:
+ human_readable = f"{hours}h {minutes}m {secs}s"
+ else:
+ human_readable = f"{minutes}m {secs}s"
+
+ return f"{raw_seconds} ({human_readable})"
+
def pil_to_base64_uri(pil_image, format="png", quality=75):
if pil_image is None:
return None