Spaces:
Running
on
Zero
Running
on
Zero
Update app_v2.py
Browse files
app_v2.py
CHANGED
|
@@ -79,6 +79,10 @@ def caption(input_image: Image.Image, prompt: str, temperature: float, top_p: fl
|
|
| 79 |
|
| 80 |
output = cap_model.generate(**generate_kwargs)
|
| 81 |
print(f"Generated {len(output[0])} tokens")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
|
| 83 |
@spaces.GPU()
|
| 84 |
@torch.no_grad()
|
|
@@ -167,7 +171,7 @@ with gr.Blocks(title="FLUX Turbo Upscaler", fill_height=True) as iface:
|
|
| 167 |
generated_image = gr.Image(type="pil", label="Generated Image", format="png", show_label=False)
|
| 168 |
with gr.Row():
|
| 169 |
with gr.Column(scale=1):
|
| 170 |
-
prompt = gr.Textbox(lines=4, placeholder="Enter your prompt here...", label="Prompt")
|
| 171 |
output_caption = gr.Textbox(label="Caption")
|
| 172 |
scale = gr.Slider(1, 3, value=1, label="Scale", step=0.25)
|
| 173 |
generate_button = gr.Button("Generate Image", variant="primary")
|
|
@@ -184,7 +188,7 @@ with gr.Blocks(title="FLUX Turbo Upscaler", fill_height=True) as iface:
|
|
| 184 |
lines=4,
|
| 185 |
value=sys_prompt,
|
| 186 |
label="System Prompt for Captioning",
|
| 187 |
-
visible=
|
| 188 |
)
|
| 189 |
temperature_slider = gr.Slider(
|
| 190 |
minimum=0.0, maximum=2.0, value=0.6, step=0.05,
|
|
@@ -214,7 +218,7 @@ with gr.Blocks(title="FLUX Turbo Upscaler", fill_height=True) as iface:
|
|
| 214 |
controlnet_conditioning_scale, guidance_scale, seed,
|
| 215 |
guidance_end, temperature_slider, top_p_slider, max_tokens_slider, log_prompt
|
| 216 |
],
|
| 217 |
-
outputs=[
|
| 218 |
)
|
| 219 |
|
| 220 |
caption_button.click(
|
|
|
|
| 79 |
|
| 80 |
output = cap_model.generate(**generate_kwargs)
|
| 81 |
print(f"Generated {len(output[0])} tokens")
|
| 82 |
+
print(f"Generated {type(output)}")
|
| 83 |
+
print(f"Generated {output}")
|
| 84 |
+
|
| 85 |
+
#return output[0]
|
| 86 |
|
| 87 |
@spaces.GPU()
|
| 88 |
@torch.no_grad()
|
|
|
|
| 171 |
generated_image = gr.Image(type="pil", label="Generated Image", format="png", show_label=False)
|
| 172 |
with gr.Row():
|
| 173 |
with gr.Column(scale=1):
|
| 174 |
+
prompt = gr.Textbox(lines=4, placeholder="Enter your prompt here...", label="Prompt", interactive=True)
|
| 175 |
output_caption = gr.Textbox(label="Caption")
|
| 176 |
scale = gr.Slider(1, 3, value=1, label="Scale", step=0.25)
|
| 177 |
generate_button = gr.Button("Generate Image", variant="primary")
|
|
|
|
| 188 |
lines=4,
|
| 189 |
value=sys_prompt,
|
| 190 |
label="System Prompt for Captioning",
|
| 191 |
+
visible=False # Changed to visible
|
| 192 |
)
|
| 193 |
temperature_slider = gr.Slider(
|
| 194 |
minimum=0.0, maximum=2.0, value=0.6, step=0.05,
|
|
|
|
| 218 |
controlnet_conditioning_scale, guidance_scale, seed,
|
| 219 |
guidance_end, temperature_slider, top_p_slider, max_tokens_slider, log_prompt
|
| 220 |
],
|
| 221 |
+
outputs=[prompt, generated_image]
|
| 222 |
)
|
| 223 |
|
| 224 |
caption_button.click(
|