Spaces:
Runtime error
Runtime error
justinpinkney
commited on
Commit
·
ed1264c
1
Parent(s):
e5371d8
Update app.py
Browse files![banner-mixer.jpeg](https://s3.amazonaws.com/moonup/production/uploads/1674039767068-62bd5f951e22ec84279820e8.jpeg)
app.py
CHANGED
@@ -130,7 +130,7 @@ def change_visible(txt1, im1, val):
|
|
130 |
return outputs
|
131 |
|
132 |
|
133 |
-
with gr.Blocks(title="Image Mixer") as demo:
|
134 |
|
135 |
gr.Markdown("")
|
136 |
gr.Markdown(
|
@@ -141,7 +141,7 @@ _Created by [Justin Pinkney](https://www.justinpinkney.com) at [Lambda Labs](htt
|
|
141 |
|
142 |
### __Provide one or more images to be mixed together by a fine-tuned Stable Diffusion model.__
|
143 |
|
144 |
-
![banner-large.jpeg](https://s3.amazonaws.com/moonup/production/uploads/
|
145 |
|
146 |
""")
|
147 |
|
@@ -152,24 +152,25 @@ _Created by [Justin Pinkney](https://www.justinpinkney.com) at [Lambda Labs](htt
|
|
152 |
|
153 |
with gr.Row():
|
154 |
for i in range(n_inputs):
|
155 |
-
with gr.
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
|
|
173 |
with gr.Row():
|
174 |
cfg_scale = gr.Slider(label="CFG scale", value=3, minimum=1, maximum=10, step=0.5)
|
175 |
n_samples = gr.Slider(label="Num samples", value=2, minimum=1, maximum=2, step=1)
|
|
|
130 |
return outputs
|
131 |
|
132 |
|
133 |
+
with gr.Blocks(title="Image Mixer", css=".gr-box {border-color: #8136e2}") as demo:
|
134 |
|
135 |
gr.Markdown("")
|
136 |
gr.Markdown(
|
|
|
141 |
|
142 |
### __Provide one or more images to be mixed together by a fine-tuned Stable Diffusion model.__
|
143 |
|
144 |
+
![banner-large.jpeg](https://s3.amazonaws.com/moonup/production/uploads/1674039767068-62bd5f951e22ec84279820e8.jpeg)
|
145 |
|
146 |
""")
|
147 |
|
|
|
152 |
|
153 |
with gr.Row():
|
154 |
for i in range(n_inputs):
|
155 |
+
with gr.Box():
|
156 |
+
with gr.Column():
|
157 |
+
btn1 = gr.Radio(
|
158 |
+
choices=["Image", "Text/URL", "Nothing"],
|
159 |
+
label=f"Input {i} type",
|
160 |
+
interactive=True,
|
161 |
+
value="Nothing",
|
162 |
+
)
|
163 |
+
txt1 = gr.Textbox(label="Text or Image URL", visible=False, interactive=True)
|
164 |
+
im1 = gr.Image(label="Image", interactive=True, visible=False, type="pil")
|
165 |
+
strength = gr.Slider(label="Strength", minimum=0, maximum=5, step=0.05, value=1, interactive=True)
|
166 |
+
|
167 |
+
fn = partial(change_visible, txt1, im1)
|
168 |
+
btn1.change(fn=fn, inputs=[btn1], outputs=[txt1, im1])
|
169 |
+
|
170 |
+
btns.append(btn1)
|
171 |
+
txts.append(txt1)
|
172 |
+
ims.append(im1)
|
173 |
+
strengths.append(strength)
|
174 |
with gr.Row():
|
175 |
cfg_scale = gr.Slider(label="CFG scale", value=3, minimum=1, maximum=10, step=0.5)
|
176 |
n_samples = gr.Slider(label="Num samples", value=2, minimum=1, maximum=2, step=1)
|