Spaces:
Running
Running
Sebastiankay
commited on
Commit
•
f65bcd2
1
Parent(s):
c711d64
Sep 10, 2024, 3:28 PM
Browse files
app.py
CHANGED
@@ -130,10 +130,11 @@ def image_get_dominant_color(image_path):
|
|
130 |
|
131 |
# MARK: PROCESS IMAGE
|
132 |
def process(Prompt, image_width, image_height, image_seed, randomize_seed):
|
133 |
-
|
134 |
if Prompt == "":
|
135 |
gr.Info("Kein Prompt angegeben, es wird ein zufälliger Prompt generiert.", duration=15)
|
136 |
Prompt = groq_enhance_process("random prompt")
|
|
|
137 |
|
138 |
used_seed = random.randint(0, MAX_SEED) if image_seed == 0 or randomize_seed else image_seed
|
139 |
used_model = "turbo" if int(image_width) > 1024 or int(image_height) > 1024 else "flux" # turbo, flux
|
@@ -155,7 +156,7 @@ def process(Prompt, image_width, image_height, image_seed, randomize_seed):
|
|
155 |
img_dominant_color = image_get_dominant_color(file_path)
|
156 |
img_width, img_height = image_get_size(file_path)
|
157 |
|
158 |
-
return ({"value": file_path, "__type__": "update"}, {"value": None, "visible": False, "__type__": "update"}, img_exif_comment, {"visible": True, "__type__": "update"}, {"value": Prompt, "visible": True, "__type__": "update"}, img_width, img_height, used_seed, {"value": file_path, "visible": True, "__type__": "update"}, img_dominant_color, used_seed)
|
159 |
|
160 |
|
161 |
# MARK: Gradio BLOCKS UI
|
|
|
130 |
|
131 |
# MARK: PROCESS IMAGE
|
132 |
def process(Prompt, image_width, image_height, image_seed, randomize_seed):
|
133 |
+
random_prompt_value = None
|
134 |
if Prompt == "":
|
135 |
gr.Info("Kein Prompt angegeben, es wird ein zufälliger Prompt generiert.", duration=15)
|
136 |
Prompt = groq_enhance_process("random prompt")
|
137 |
+
random_prompt_value = Prompt
|
138 |
|
139 |
used_seed = random.randint(0, MAX_SEED) if image_seed == 0 or randomize_seed else image_seed
|
140 |
used_model = "turbo" if int(image_width) > 1024 or int(image_height) > 1024 else "flux" # turbo, flux
|
|
|
156 |
img_dominant_color = image_get_dominant_color(file_path)
|
157 |
img_width, img_height = image_get_size(file_path)
|
158 |
|
159 |
+
return ({"value": file_path, "__type__": "update"}, {"value": None, "visible": False, "__type__": "update"}, img_exif_comment, {"visible": True, "__type__": "update"}, {"value": Prompt, "visible": True, "__type__": "update"}, img_width, img_height, used_seed, {"value": file_path, "visible": True, "__type__": "update"}, img_dominant_color, used_seed, {"value": random_prompt_value, "visible": True, "__type__": "update"})
|
160 |
|
161 |
|
162 |
# MARK: Gradio BLOCKS UI
|