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') with gr.Accordion("Negative Prompt"): text_neg_prompt = gr.Textbox(label='Negative Prompt') text_ip_scale = gr.Slider(0.0, 1.0, value=0.6, label="IP-Adapter Scale"), 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_ip_scale = gr.Slider(0.0, 1.0, value=0.6, label="IP-Adapter Scale"), 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_ip_scale = gr.Slider(0.0, 1.0, value=0.6, label="IP-Adapter Scale"), inpaint_button = gr.Button("Generate") output_image = gr.Image(label='Result') demo.launch()