Update app.py
Browse files
app.py
CHANGED
@@ -58,6 +58,7 @@ def generate(region1_concept,
|
|
58 |
region2_prompt = f'<{region2_concept}1> <{region2_concept}2>, {region2_prompt}, {region_pos_prompt}'
|
59 |
prompt_rewrite=f"{region1_prompt}-*-{region_neg_prompt}-*-{region1}|{region2_prompt}-*-{region_neg_prompt}-*-{region2}"
|
60 |
print(prompt_rewrite)
|
|
|
61 |
|
62 |
result = infer(pretrained_model,
|
63 |
prompt,
|
@@ -186,14 +187,13 @@ def on_select(evt: gr.SelectData): # SelectData is a subclass of EventData
|
|
186 |
return evt.value['image']['orig_name']
|
187 |
|
188 |
examples_context = [
|
189 |
-
'walking
|
190 |
-
'Two people walking on the busy street of New York',
|
191 |
'in the forest',
|
192 |
'in the style of cyberpunk'
|
193 |
]
|
194 |
|
195 |
-
examples_region1 = ['
|
196 |
-
examples_region2 = ['smiling, wearing a blue
|
197 |
|
198 |
with open('multi-concept/pose_data/pose.json') as f:
|
199 |
d = json.load(f)
|
@@ -233,16 +233,17 @@ with gr.Blocks(css=css) as demo:
|
|
233 |
|
234 |
with gr.Row():
|
235 |
|
236 |
-
concept_list = ["Elsa", "Moana", "Woody", "Rapunzel", "Elastigirl",
|
|
|
237 |
region1_concept = gr.Dropdown(
|
238 |
concept_list,
|
239 |
label="Character 1",
|
240 |
-
info="Will add more characters later!"
|
241 |
)
|
242 |
region2_concept = gr.Dropdown(
|
243 |
concept_list,
|
244 |
label="Character 2",
|
245 |
-
info="Will add more characters later!"
|
246 |
)
|
247 |
|
248 |
|
@@ -295,7 +296,7 @@ with gr.Blocks(css=css) as demo:
|
|
295 |
interactive=False, show_download_button=False,
|
296 |
preview=True, height = 400, object_fit="scale-down")
|
297 |
|
298 |
-
pose_image_name = gr.Textbox(
|
299 |
gallery.select(on_select, None, pose_image_name)
|
300 |
|
301 |
run_button = gr.Button("Run", scale=1)
|
|
|
58 |
region2_prompt = f'<{region2_concept}1> <{region2_concept}2>, {region2_prompt}, {region_pos_prompt}'
|
59 |
prompt_rewrite=f"{region1_prompt}-*-{region_neg_prompt}-*-{region1}|{region2_prompt}-*-{region_neg_prompt}-*-{region2}"
|
60 |
print(prompt_rewrite)
|
61 |
+
prompt+=", Disney style photo, High resolution"
|
62 |
|
63 |
result = infer(pretrained_model,
|
64 |
prompt,
|
|
|
187 |
return evt.value['image']['orig_name']
|
188 |
|
189 |
examples_context = [
|
190 |
+
'walking on the busy streets of New York',
|
|
|
191 |
'in the forest',
|
192 |
'in the style of cyberpunk'
|
193 |
]
|
194 |
|
195 |
+
examples_region1 = ['In a casual t-shirt', 'wearing jeans']
|
196 |
+
examples_region2 = ['smiling, wearing a blue hoodie']
|
197 |
|
198 |
with open('multi-concept/pose_data/pose.json') as f:
|
199 |
d = json.load(f)
|
|
|
233 |
|
234 |
with gr.Row():
|
235 |
|
236 |
+
concept_list = ["Elsa", "Moana", "Woody", "Rapunzel", "Elastigirl",
|
237 |
+
"Linguini", "Raya", "Hiro", "Mirabel", "Miguel"]
|
238 |
region1_concept = gr.Dropdown(
|
239 |
concept_list,
|
240 |
label="Character 1",
|
241 |
+
# info="Will add more characters later!"
|
242 |
)
|
243 |
region2_concept = gr.Dropdown(
|
244 |
concept_list,
|
245 |
label="Character 2",
|
246 |
+
# info="Will add more characters later!"
|
247 |
)
|
248 |
|
249 |
|
|
|
296 |
interactive=False, show_download_button=False,
|
297 |
preview=True, height = 400, object_fit="scale-down")
|
298 |
|
299 |
+
pose_image_name = gr.Textbox(label="You selected: ", interactive=False)
|
300 |
gallery.select(on_select, None, pose_image_name)
|
301 |
|
302 |
run_button = gr.Button("Run", scale=1)
|