Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -200,13 +200,11 @@ def process_and_generate(google_api_key, stability_api_key, prompt, style, steps
|
|
200 |
State("stability-api-key", "value"),
|
201 |
State("prompt", "value"),
|
202 |
State("style", "value"),
|
203 |
-
State("cfg-scale", "value"),
|
204 |
State("steps", "value"),
|
205 |
State("aspect-ratio", "value")],
|
206 |
prevent_initial_call=True
|
207 |
)
|
208 |
-
|
209 |
-
def update_output(n_clicks, google_api_key, stability_api_key, prompt, style, cfg_scale, steps, aspect_ratio):
|
210 |
if n_clicks is None:
|
211 |
raise PreventUpdate
|
212 |
|
@@ -218,7 +216,7 @@ def update_output(n_clicks, google_api_key, stability_api_key, prompt, style, cf
|
|
218 |
status["message"] = message
|
219 |
|
220 |
def run_process():
|
221 |
-
image_bytes, enhanced_prompt = process_and_generate(google_api_key, stability_api_key, prompt, style,
|
222 |
if image_bytes:
|
223 |
encoded_image = base64.b64encode(image_bytes).decode('ascii')
|
224 |
return f"data:image/jpeg;base64,{encoded_image}", f"Enhanced Prompt: {enhanced_prompt}", status["message"], False
|
|
|
200 |
State("stability-api-key", "value"),
|
201 |
State("prompt", "value"),
|
202 |
State("style", "value"),
|
|
|
203 |
State("steps", "value"),
|
204 |
State("aspect-ratio", "value")],
|
205 |
prevent_initial_call=True
|
206 |
)
|
207 |
+
def update_output(n_clicks, google_api_key, stability_api_key, prompt, style, steps, aspect_ratio):
|
|
|
208 |
if n_clicks is None:
|
209 |
raise PreventUpdate
|
210 |
|
|
|
216 |
status["message"] = message
|
217 |
|
218 |
def run_process():
|
219 |
+
image_bytes, enhanced_prompt = process_and_generate(google_api_key, stability_api_key, prompt, style, steps, aspect_ratio, set_status)
|
220 |
if image_bytes:
|
221 |
encoded_image = base64.b64encode(image_bytes).decode('ascii')
|
222 |
return f"data:image/jpeg;base64,{encoded_image}", f"Enhanced Prompt: {enhanced_prompt}", status["message"], False
|