Spaces:
Running
on
Zero
Running
on
Zero
Update raw.py
Browse files
raw.py
CHANGED
@@ -184,8 +184,28 @@ with gr.Blocks(title="FLUX Turbo Upscaler", fill_height=True) as iface:
|
|
184 |
|
185 |
|
186 |
with gr.Row():
|
187 |
-
|
188 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
189 |
gr.Markdown("**Tips:** 8 steps is all you need!")
|
190 |
|
191 |
generate_button.click(
|
@@ -194,8 +214,8 @@ with gr.Blocks(title="FLUX Turbo Upscaler", fill_height=True) as iface:
|
|
194 |
outputs=[generated_image]
|
195 |
)
|
196 |
caption_button.click(
|
197 |
-
caption,
|
198 |
-
inputs=[control_image, prompt_box,
|
199 |
outputs=output_caption,
|
200 |
)
|
201 |
# Launch the app
|
|
|
184 |
|
185 |
|
186 |
with gr.Row():
|
187 |
+
with gr.Accordion("Generation settings", open=False):
|
188 |
+
prompt_box = gr.Textbox(lines=4, value="Write a straightforward caption for this image. Begin with the main subject and medium. Mention pivotal elements—people, objects, scenery—using confident, definite language. Focus on concrete details like color, shape, texture, and spatial relationships. Show how elements interact. Omit mood and speculative wording. If text is present, quote it exactly. Note any watermarks, signatures, or compression artifacts. Never mention what's absent, resolution, or unobservable details. Vary your sentence structure and keep the description concise, without starting with “This image is…” or similar phrasing.", visible=False)
|
189 |
+
temperature_slider = gr.Slider(
|
190 |
+
minimum=0.0, maximum=2.0, value=0.6, step=0.05,
|
191 |
+
label="Temperature",
|
192 |
+
info="Higher values make the output more random, lower values make it more deterministic.",
|
193 |
+
visible=False
|
194 |
+
)
|
195 |
+
top_p_slider = gr.Slider(
|
196 |
+
minimum=0.0, maximum=1.0, value=0.9, step=0.01,
|
197 |
+
label="Top-p",
|
198 |
+
visible=False
|
199 |
+
)
|
200 |
+
max_tokens_slider = gr.Slider(
|
201 |
+
minimum=1, maximum=2048, value=512, step=1,
|
202 |
+
label="Max New Tokens",
|
203 |
+
info="Maximum number of tokens to generate. The model will stop generating if it reaches this limit.",
|
204 |
+
visible=False
|
205 |
+
)
|
206 |
+
|
207 |
+
log_prompt = gr.Checkbox(value=True, label="Help improve JoyCaption by logging your text query", visible=False)
|
208 |
+
|
209 |
gr.Markdown("**Tips:** 8 steps is all you need!")
|
210 |
|
211 |
generate_button.click(
|
|
|
214 |
outputs=[generated_image]
|
215 |
)
|
216 |
caption_button.click(
|
217 |
+
fn=caption,
|
218 |
+
inputs=[control_image, prompt_box, temperature_slider, top_p_slider, max_tokens_slider, log_prompt],
|
219 |
outputs=output_caption,
|
220 |
)
|
221 |
# Launch the app
|