Spaces:
Running
on
Zero
Running
on
Zero
ui change
Browse files
app.py
CHANGED
@@ -34,7 +34,7 @@ clip_model.to(device)
|
|
34 |
|
35 |
CONCEPTS_MAP={
|
36 |
"age": "age_descriptions.npy",
|
37 |
-
"
|
38 |
"dogs": "dog_descriptions.npy",
|
39 |
"emotions": "emotion_descriptions.npy",
|
40 |
"flowers": "flower_descriptions.npy",
|
@@ -197,27 +197,21 @@ following the algorithm proposed in [*IP-Composer: Semantic Composition of Visua
|
|
197 |
with gr.Row():
|
198 |
with gr.Column():
|
199 |
base_image = gr.Image(label="Base Image (Required)", type="numpy")
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
with gr.Row():
|
216 |
-
with gr.Column(scale=2):
|
217 |
-
concept_image3 = gr.Image(label="Concept Image 3 (Optional)", type="numpy")
|
218 |
-
with gr.Row():
|
219 |
-
concept_name3 = gr.Dropdown(concept_options, label="concept 3", value= None, info="concept type")
|
220 |
-
rank3 = gr.Slider(minimum=1, maximum=50, value=30, step=1, label="Rank 3")
|
221 |
|
222 |
submit_btn = gr.Button("Generate")
|
223 |
|
@@ -226,13 +220,12 @@ following the algorithm proposed in [*IP-Composer: Semantic Composition of Visua
|
|
226 |
with gr.Row():
|
227 |
scale = gr.Slider(minimum=0.1, maximum=2.0, value=1.0, step=0.1, label="Scale")
|
228 |
randomize_seed = gr.Checkbox(value=True, label="Randomize seed")
|
229 |
-
seed = gr.Number(value=0, label="Seed", precision=0)
|
230 |
-
|
231 |
-
|
232 |
|
233 |
with gr.Column():
|
234 |
output_image = gr.Image(label="composed output", show_label=True)
|
235 |
|
|
|
236 |
submit_btn.click(
|
237 |
fn=randomize_seed_fn,
|
238 |
inputs=[seed, randomize_seed],
|
|
|
34 |
|
35 |
CONCEPTS_MAP={
|
36 |
"age": "age_descriptions.npy",
|
37 |
+
"animal fur": "fur_descriptions.npy",
|
38 |
"dogs": "dog_descriptions.npy",
|
39 |
"emotions": "emotion_descriptions.npy",
|
40 |
"flowers": "flower_descriptions.npy",
|
|
|
197 |
with gr.Row():
|
198 |
with gr.Column():
|
199 |
base_image = gr.Image(label="Base Image (Required)", type="numpy")
|
200 |
+
with gr.Tab("concepts"):
|
201 |
+
with gr.Row():
|
202 |
+
with gr.Group():
|
203 |
+
concept_image1 = gr.Image(label="Concept Image 1 (Required)", type="numpy")
|
204 |
+
concept_name1 = gr.Dropdown(concept_options, label="concept 1", value=None, info="concept type")
|
205 |
+
rank1 = gr.Slider(minimum=1, maximum=50, value=30, step=1, label="Rank 1")
|
206 |
+
with gr.Group():
|
207 |
+
concept_image2 = gr.Image(label="Concept Image 2 (Optional)", type="numpy")
|
208 |
+
concept_name2 = gr.Dropdown(concept_options, label="concept 2", value=None, info="concept type")
|
209 |
+
rank2 = gr.Slider(minimum=1, maximum=50, value=30, step=1, label="Rank 2")
|
210 |
+
with gr.Tab("optional - 3rd concept"):
|
211 |
+
with gr.Group():
|
212 |
+
concept_image3 = gr.Image(label="Concept Image 3 (Optional)", type="numpy")
|
213 |
+
concept_name3 = gr.Dropdown(concept_options, label="concept 3", value= None, info="concept type")
|
214 |
+
rank3 = gr.Slider(minimum=1, maximum=50, value=30, step=1, label="Rank 3")
|
|
|
|
|
|
|
|
|
|
|
|
|
215 |
|
216 |
submit_btn = gr.Button("Generate")
|
217 |
|
|
|
220 |
with gr.Row():
|
221 |
scale = gr.Slider(minimum=0.1, maximum=2.0, value=1.0, step=0.1, label="Scale")
|
222 |
randomize_seed = gr.Checkbox(value=True, label="Randomize seed")
|
223 |
+
seed = gr.Number(value=0, label="Seed", precision=0)
|
|
|
|
|
224 |
|
225 |
with gr.Column():
|
226 |
output_image = gr.Image(label="composed output", show_label=True)
|
227 |
|
228 |
+
|
229 |
submit_btn.click(
|
230 |
fn=randomize_seed_fn,
|
231 |
inputs=[seed, randomize_seed],
|