Spaces:
Runtime error
Runtime error
Commit ·
d76eab0
1
Parent(s): d2f86ce
WIP
Browse files305 unmodified lines3063073083093093103113123133123133143153163173193183193203211 unmodified line3233243253273263273283293 unmodified lines3333343353373363373393403413423433443453463473483383393401 unmodified line342343344345346347348349350351352353354355356305 unmodified lines# --------------------------------------------------css = """#wrapper {max-width: 960px; margin: 0 auto;}"""with gr.Blocks(css=css, elem_id="wrapper") as demo: gr.Markdown("## FLUX.1‑dev‑ControlNet‑Union‑Pro") gr.Markdown("## FLUX.1‑dev‑ControlNet‑Union‑Pro by Frank") gr.Markdown( "A unified ControlNet for **FLUX.1‑dev** from the InstantX team and Shakker Labs. " + "Recommended strengths: *canny 0.65*, *tile 0.45*, *depth 0.55*, *blur 0.45*, " + "*openpose 0.55*, *gray 0.45*, *low quality 0.40*. Long prompts usually help." + "Recommended strengths: *canny 0.76*. Long prompts usually help." )
# ------------ Image panel row ------------ with gr.Row(): control_image = gr.Image( label="Upload a processed control image", label="Upload animage", type="pil", height=512 + 256, )1 unmodified line preview_image = gr.Image(label="Pre‑processed Cond", height=512 + 256)
# ------------ Prompt ------------ prompt_txt = gr.Textbox(label="Prompt", value="Una imagen bonita", lines=1) prompt_txt = gr.Textbox(label="Prompt", value="White background", lines=1)
# ------------ ControlNet settings ------------ with gr.Row():3 unmodified lines choices=list(MODE_MAPPING.keys()), value="canny", label="Mode" ) strength_slider = gr.Slider( 0.0, 1.0, value=0.9, step=0.01, label="control strength" 0.0, 1.0, value=0.76, step=0.01, label="control strength" ) with gr.Column(): seed_slider = gr.Slider(0, MAX_SEED, step=1, value=42, label="Seed") randomize_chk = gr.Checkbox(label="Randomize seed", value=False) guidance_slider = gr.Slider( 0.0, 10.0, step=0.1, value=3.5, label="Guidance scale" ) steps_slider = gr.Slider(1, 50, step=1, value=24, label="Inference steps")
with gr.Row(): with gr.Column(): gr.Markdown("### Preprocess") canny_threshold_1 = gr.Slider( 0, 500, step=1, value=100, label="Canny threshold 1"1 unmodified line canny_threshold_2 = gr.Slider( 0, 500, step=1, value=200, label="Canny threshold 2" )
with gr.Column(): seed_slider = gr.Slider(0, MAX_SEED, step=1, value=42, label="Seed") randomize_chk = gr.Checkbox(label="Randomize seed", value=False) guidance_slider = gr.Slider( 0.0, 10.0, step=0.1, value=3.5, label="Guidance scale" ) steps_slider = gr.Slider(1, 50, step=1, value=50, label="Inference steps")
submit_btn = gr.Button("Submit")
submit_btn.click(app.py+14-16