import gradio as gr with gr.Blocks() as demo: gr.Markdown(""" # IP-Adapter Playground by [Tony Assi](https://www.tonyassi.com/) """) with gr.Row(): with gr.Tab("Text-to-Image"): text_ip = gr.Image(label='IP-Adapter Image') text_prompt = gr.Textbox(label='Prompt') text_button = gr.Button("Generate") with gr.Tab("Image-to-Image"): image_ip = gr.Image(label='IP-Adapter Image') image_image = gr.Image(label='Image') image_prompt = gr.Textbox(label='Prompt') image_button = gr.Button("Generate") with gr.Tab("Inpainting"): inpaint_ip = gr.Image(label='IP-Adapter Image') inpaint_editor = gr.ImageEditor(label='Image + Mask') inpaint_prompt = gr.Textbox(label='Prompt') inpaint_button = gr.Button("Generate") output_image = gr.Image(label='Result') with gr.Accordion("Advanced Settings", open=False): neg_prompt = gr.Textbox(label='Negative Prompt', value='ugly, deformed, nsfw') width_slider = gr.Slider(256, 1024, value=1024, label="Width") height_slider = gr.Slider(256, 1024, value=1024, label="Height") ip_scale_slider = gr.Slider(0.0, 1.0, value=0.6, label="IP-Adapter Scale") strength_slider = gr.Slider(0.0, 1.0, value=0.7, label="Strength") guidance_slider = gr.Slider(1.0, 15.0, value=7.5, label="Guidance") steps_slider = gr.Slider(50, 100, value=75, label="Steps") demo.launch()