Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -39,7 +39,6 @@ def run(*args):
|
|
39 |
if id_image is not None:
|
40 |
id_image = resize_numpy_image_long(id_image, 1024)
|
41 |
id_embeddings = pipeline.get_id_embedding(id_image)
|
42 |
-
# for supp_id_image in supp_images:
|
43 |
if supp_images is not None:
|
44 |
sup_images = resize_numpy_image_long(supp_images, 1024)
|
45 |
supp_id_embeddings = pipeline.get_id_embedding(supp_images)
|
@@ -92,7 +91,7 @@ function refresh() {
|
|
92 |
"""
|
93 |
|
94 |
|
95 |
-
with gr.Blocks(
|
96 |
gr.Markdown(_MARKDOWN_)
|
97 |
with gr.Row():
|
98 |
with gr.Column():
|
@@ -102,12 +101,6 @@ with gr.Blocks(title="ToonMagev2", js = js_func, theme = theme) as SAK:
|
|
102 |
supp_image1 = gr.Image(
|
103 |
label="Additional ID image (auxiliary)", sources="upload", type="numpy", height=256
|
104 |
)
|
105 |
-
# supp_image2 = gr.Image(
|
106 |
-
# label="Additional ID image (auxiliary)", sources="upload", type="numpy", height=256
|
107 |
-
# )
|
108 |
-
# supp_image3 = gr.Image(
|
109 |
-
# label="Additional ID image (auxiliary)", sources="upload", type="numpy", height=256
|
110 |
-
# )
|
111 |
prompt = gr.Textbox(label="Prompt", value='portrait,cinematic,wolf ears,white hair')
|
112 |
|
113 |
neg_prompt = gr.Textbox(label="Negative Prompt", value=DEFAULT_NEGATIVE_PROMPT)
|
@@ -199,8 +192,8 @@ with gr.Blocks(title="ToonMagev2", js = js_func, theme = theme) as SAK:
|
|
199 |
example_inps = [
|
200 |
[
|
201 |
'portrait, superman',
|
202 |
-
'sample_img/
|
203 |
-
'sample_img/
|
204 |
'fidelity',
|
205 |
True,
|
206 |
]
|
@@ -210,13 +203,10 @@ with gr.Blocks(title="ToonMagev2", js = js_func, theme = theme) as SAK:
|
|
210 |
with gr.Column():
|
211 |
output = gr.Gallery(label='Output', elem_id="gallery")
|
212 |
intermediate_output = gr.Gallery(label='DebugImage', elem_id="gallery", visible=False)
|
213 |
-
# gr.Markdown(_CITE_)
|
214 |
|
215 |
inps = [
|
216 |
face_image,
|
217 |
supp_image1,
|
218 |
-
# supp_image2,
|
219 |
-
# supp_image3,
|
220 |
prompt,
|
221 |
neg_prompt,
|
222 |
id_scale,
|
|
|
39 |
if id_image is not None:
|
40 |
id_image = resize_numpy_image_long(id_image, 1024)
|
41 |
id_embeddings = pipeline.get_id_embedding(id_image)
|
|
|
42 |
if supp_images is not None:
|
43 |
sup_images = resize_numpy_image_long(supp_images, 1024)
|
44 |
supp_id_embeddings = pipeline.get_id_embedding(supp_images)
|
|
|
91 |
"""
|
92 |
|
93 |
|
94 |
+
with gr.Blocks(js = js_func, theme = theme, title="ToonMagev2") as SAK:
|
95 |
gr.Markdown(_MARKDOWN_)
|
96 |
with gr.Row():
|
97 |
with gr.Column():
|
|
|
101 |
supp_image1 = gr.Image(
|
102 |
label="Additional ID image (auxiliary)", sources="upload", type="numpy", height=256
|
103 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
prompt = gr.Textbox(label="Prompt", value='portrait,cinematic,wolf ears,white hair')
|
105 |
|
106 |
neg_prompt = gr.Textbox(label="Negative Prompt", value=DEFAULT_NEGATIVE_PROMPT)
|
|
|
192 |
example_inps = [
|
193 |
[
|
194 |
'portrait, superman',
|
195 |
+
'sample_img/image1.png',
|
196 |
+
'sample_img/sample_img_test24.jpg',
|
197 |
'fidelity',
|
198 |
True,
|
199 |
]
|
|
|
203 |
with gr.Column():
|
204 |
output = gr.Gallery(label='Output', elem_id="gallery")
|
205 |
intermediate_output = gr.Gallery(label='DebugImage', elem_id="gallery", visible=False)
|
|
|
206 |
|
207 |
inps = [
|
208 |
face_image,
|
209 |
supp_image1,
|
|
|
|
|
210 |
prompt,
|
211 |
neg_prompt,
|
212 |
id_scale,
|