Spaces:
Running
on
Zero
Running
on
Zero
attempt 3
Browse files
app_v3.py
CHANGED
|
@@ -114,8 +114,6 @@ def process_image(control_image, user_prompt, system_prompt, scale, steps,
|
|
| 114 |
# Generate a detailed caption
|
| 115 |
mcaption = model.caption(control_image, length="normal")
|
| 116 |
detailed_caption = mcaption["caption"]
|
| 117 |
-
print(f"Detailed caption: {detailed_caption}")
|
| 118 |
-
|
| 119 |
final_prompt = detailed_caption
|
| 120 |
yield f"Using caption: {final_prompt}", None, final_prompt
|
| 121 |
|
|
@@ -137,7 +135,7 @@ def process_image(control_image, user_prompt, system_prompt, scale, steps,
|
|
| 137 |
log_params(final_prompt, scale, steps, controlnet_conditioning_scale, guidance_scale, seed, guidance_end, control_image, image)
|
| 138 |
yield f"Completed! Used prompt: {final_prompt}", image, final_prompt
|
| 139 |
except Exception as e:
|
| 140 |
-
yield f"Error: {str(e)}", None
|
| 141 |
|
| 142 |
def handle_outputs(outputs):
|
| 143 |
if isinstance(outputs, dict) and outputs.get("__type__") == "update_caption":
|
|
|
|
| 114 |
# Generate a detailed caption
|
| 115 |
mcaption = model.caption(control_image, length="normal")
|
| 116 |
detailed_caption = mcaption["caption"]
|
|
|
|
|
|
|
| 117 |
final_prompt = detailed_caption
|
| 118 |
yield f"Using caption: {final_prompt}", None, final_prompt
|
| 119 |
|
|
|
|
| 135 |
log_params(final_prompt, scale, steps, controlnet_conditioning_scale, guidance_scale, seed, guidance_end, control_image, image)
|
| 136 |
yield f"Completed! Used prompt: {final_prompt}", image, final_prompt
|
| 137 |
except Exception as e:
|
| 138 |
+
yield f"Error: {str(e)}", None, None
|
| 139 |
|
| 140 |
def handle_outputs(outputs):
|
| 141 |
if isinstance(outputs, dict) and outputs.get("__type__") == "update_caption":
|