Spaces:
Build error
Build error
Commit ·
ed1264c
1
Parent(s): e5371d8
Update app.py
Browse files
129 unmodified lines1301311321331341351364 unmodified lines1411421431441451461474 unmodified lines152153154155156157158159160161162163164165166167168169170171172173174175129 unmodified linesreturn outputswith gr.Blocks(title="Image Mixer") as demo:gr.Markdown("")gr.Markdown(4 unmodified lines### __Provide one or more images to be mixed together by a fine-tuned Stable Diffusion model.__""")4 unmodified lineswith gr.Row():for i in range(n_inputs):with gr.Column():btn1 = gr.Radio(choices=["Image", "Text/URL", "Nothing"],label=f"Input {i} type",interactive=True,value="Nothing",)txt1 = gr.Textbox(label="Text or Image URL", visible=False, interactive=True)im1 = gr.Image(label="Image", interactive=True, visible=False, type="pil")strength = gr.Slider(label="Strength", minimum=0, maximum=5, step=0.05, value=1, interactive=True)fn = partial(change_visible, txt1, im1)btn1.change(fn=fn, inputs=[btn1], outputs=[txt1, im1])btns.append(btn1)txts.append(txt1)ims.append(im1)strengths.append(strength)with gr.Row():cfg_scale = gr.Slider(label="CFG scale", value=3, minimum=1, maximum=10, step=0.5)n_samples = gr.Slider(label="Num samples", value=2, minimum=1, maximum=2, step=1)129 unmodified lines1301311321331341351364 unmodified lines1411421431441451461474 unmodified lines152153154155156157158159160161162163164165166167168169170171172173174175176129 unmodified linesreturn outputswith gr.Blocks(title="Image Mixer", css=".gr-box {border-color: #8136e2}") as demo:gr.Markdown("")gr.Markdown(4 unmodified lines### __Provide one or more images to be mixed together by a fine-tuned Stable Diffusion model.__""")4 unmodified lineswith gr.Row():for i in range(n_inputs):with gr.Box():with gr.Column():btn1 = gr.Radio(choices=["Image", "Text/URL", "Nothing"],label=f"Input {i} type",interactive=True,value="Nothing",)txt1 = gr.Textbox(label="Text or Image URL", visible=False, interactive=True)im1 = gr.Image(label="Image", interactive=True, visible=False, type="pil")strength = gr.Slider(label="Strength", minimum=0, maximum=5, step=0.05, value=1, interactive=True)fn = partial(change_visible, txt1, im1)btn1.change(fn=fn, inputs=[btn1], outputs=[txt1, im1])btns.append(btn1)txts.append(txt1)ims.append(im1)strengths.append(strength)with gr.Row():cfg_scale = gr.Slider(label="CFG scale", value=3, minimum=1, maximum=10, step=0.5)n_samples = gr.Slider(label="Num samples", value=2, minimum=1, maximum=2, step=1)
app.py+21-20