Spaces:
Running
on
Zero
Running
on
Zero
Update generate_caption function to return a placeholder message when no control image is provided, and initialize space in app_v4.py
Browse files
app_v4.py
CHANGED
|
@@ -85,7 +85,7 @@ def combine_caption_focus(caption, focus):
|
|
| 85 |
|
| 86 |
def generate_caption(control_image):
|
| 87 |
if control_image is None:
|
| 88 |
-
return
|
| 89 |
|
| 90 |
# Generate a detailed caption
|
| 91 |
mcaption = model.caption(control_image, length="short")
|
|
@@ -239,4 +239,5 @@ with gr.Blocks(title="FLUX Turbo Upscaler", fill_height=True) as demo:
|
|
| 239 |
outputs=[prompt]
|
| 240 |
)
|
| 241 |
|
|
|
|
| 242 |
demo.launch(show_error=True)
|
|
|
|
| 85 |
|
| 86 |
def generate_caption(control_image):
|
| 87 |
if control_image is None:
|
| 88 |
+
return "Waiting for control image..."
|
| 89 |
|
| 90 |
# Generate a detailed caption
|
| 91 |
mcaption = model.caption(control_image, length="short")
|
|
|
|
| 239 |
outputs=[prompt]
|
| 240 |
)
|
| 241 |
|
| 242 |
+
init_space()
|
| 243 |
demo.launch(show_error=True)
|