Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -105,6 +105,13 @@ with gr.Blocks() as demo:
|
|
105 |
text_ip = gr.Image(label='IP-Adapter Image', type='pil')
|
106 |
text_prompt = gr.Textbox(label='Prompt')
|
107 |
text_button = gr.Button("Generate")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
with gr.Tab("Image-to-Image"):
|
109 |
image_ip = gr.Image(label='IP-Adapter Image', type='pil')
|
110 |
image_image = gr.Image(label='Image', type='pil')
|
@@ -122,11 +129,13 @@ with gr.Blocks() as demo:
|
|
122 |
neg_prompt = gr.Textbox(label='Negative Prompt', value='ugly, deformed, nsfw')
|
123 |
width_slider = gr.Slider(256, 1024, value=1024, step=8, label="Width")
|
124 |
height_slider = gr.Slider(256, 1024, value=1024, step=8, label="Height")
|
125 |
-
ip_scale_slider = gr.Slider(0.0, 1.0, value=0.
|
126 |
strength_slider = gr.Slider(0.0, 1.0, value=0.7, label="Strength")
|
127 |
guidance_slider = gr.Slider(1.0, 15.0, value=7.5, label="Guidance")
|
128 |
steps_slider = gr.Slider(50, 100, value=75, step=1, label="Steps")
|
129 |
|
|
|
|
|
130 |
text_button.click(text_to_image, inputs=[text_ip, text_prompt, neg_prompt, width_slider, height_slider, ip_scale_slider, strength_slider, guidance_slider, steps_slider], outputs=output_image)
|
131 |
image_button.click(image_to_image, inputs=[image_ip, image_image, image_prompt, neg_prompt, width_slider, height_slider, ip_scale_slider, strength_slider, guidance_slider, steps_slider], outputs=output_image)
|
132 |
inpaint_button.click(inpaint, inputs=[inpaint_ip, inpaint_editor, inpaint_prompt, neg_prompt, width_slider, height_slider, ip_scale_slider, strength_slider, guidance_slider, steps_slider], outputs=output_image)
|
|
|
105 |
text_ip = gr.Image(label='IP-Adapter Image', type='pil')
|
106 |
text_prompt = gr.Textbox(label='Prompt')
|
107 |
text_button = gr.Button("Generate")
|
108 |
+
gr.Examples(
|
109 |
+
[["./images/img1.jpg", "Paris Hilton", "ugly, deformed, nsfw", 1024, 1024, 0.8, 0.7, 7.5, 75]],
|
110 |
+
text_ip, text_prompt, neg_prompt, width_slider, height_slider, ip_scale_slider, strength_slider, guidance_slider, steps_slider,
|
111 |
+
output_image,
|
112 |
+
text_to_image,
|
113 |
+
cache_examples=True,
|
114 |
+
)
|
115 |
with gr.Tab("Image-to-Image"):
|
116 |
image_ip = gr.Image(label='IP-Adapter Image', type='pil')
|
117 |
image_image = gr.Image(label='Image', type='pil')
|
|
|
129 |
neg_prompt = gr.Textbox(label='Negative Prompt', value='ugly, deformed, nsfw')
|
130 |
width_slider = gr.Slider(256, 1024, value=1024, step=8, label="Width")
|
131 |
height_slider = gr.Slider(256, 1024, value=1024, step=8, label="Height")
|
132 |
+
ip_scale_slider = gr.Slider(0.0, 1.0, value=0.8, label="IP-Adapter Scale")
|
133 |
strength_slider = gr.Slider(0.0, 1.0, value=0.7, label="Strength")
|
134 |
guidance_slider = gr.Slider(1.0, 15.0, value=7.5, label="Guidance")
|
135 |
steps_slider = gr.Slider(50, 100, value=75, step=1, label="Steps")
|
136 |
|
137 |
+
|
138 |
+
|
139 |
text_button.click(text_to_image, inputs=[text_ip, text_prompt, neg_prompt, width_slider, height_slider, ip_scale_slider, strength_slider, guidance_slider, steps_slider], outputs=output_image)
|
140 |
image_button.click(image_to_image, inputs=[image_ip, image_image, image_prompt, neg_prompt, width_slider, height_slider, ip_scale_slider, strength_slider, guidance_slider, steps_slider], outputs=output_image)
|
141 |
inpaint_button.click(inpaint, inputs=[inpaint_ip, inpaint_editor, inpaint_prompt, neg_prompt, width_slider, height_slider, ip_scale_slider, strength_slider, guidance_slider, steps_slider], outputs=output_image)
|