Spaces:
Runtime error
Runtime error
Commit ·
d76eab0
1
Parent(s): d2f86ce
WIP
Browse files305 unmodified lines3063073083093103113123133143153163173183193203213221 unmodified line3243253263273283293303 unmodified lines3343353363373383393403413423433443453463473483493503511 unmodified line353354355356357358305 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("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.")# ------------ Image panel row ------------with gr.Row():control_image = gr.Image(label="Upload a processed control image",type="pil",height=512 + 256,)1 unmodified linepreview_image = gr.Image(label="Pre‑processed Cond", height=512 + 256)# ------------ Prompt ------------prompt_txt = gr.Textbox(label="Prompt", value="Una imagen bonita", lines=1)# ------------ ControlNet settings ------------with gr.Row():3 unmodified lineschoices=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")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 linecanny_threshold_2 = gr.Slider(0, 500, step=1, value=200, label="Canny threshold 2")submit_btn = gr.Button("Submit")submit_btn.click(305 unmodified lines3063073083093103113123133143153163173183193203211 unmodified line3233243253263273283293 unmodified lines3333343353363373383393401 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 by Frank")gr.Markdown("A unified ControlNet for **FLUX.1‑dev** from the InstantX team and Shakker Labs. "+ "Recommended strengths: *canny 0.76*. Long prompts usually help.")# ------------ Image panel row ------------with gr.Row():control_image = gr.Image(label="Upload animage",type="pil",height=512 + 256,)1 unmodified linepreview_image = gr.Image(label="Pre‑processed Cond", height=512 + 256)# ------------ Prompt ------------prompt_txt = gr.Textbox(label="Prompt", value="White background", lines=1)# ------------ ControlNet settings ------------with gr.Row():3 unmodified lineschoices=list(MODE_MAPPING.keys()), value="canny", label="Mode")strength_slider = gr.Slider(0.0, 1.0, value=0.76, step=0.01, label="control strength")gr.Markdown("### Preprocess")canny_threshold_1 = gr.Slider(0, 500, step=1, value=100, label="Canny threshold 1"1 unmodified linecanny_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