Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -58,7 +58,7 @@ def run(*args):
|
|
58 |
|
59 |
|
60 |
_MARKDOWN_ = """
|
61 |
-
<h2><b>This is the demo for
|
62 |
|
63 |
**Tips**
|
64 |
|
@@ -72,7 +72,7 @@ _MARKDOWN_ = """
|
|
72 |
|
73 |
Try out with different prompts using your image and do provide your feedback.
|
74 |
|
75 |
-
Note:
|
76 |
|
77 |
**Demo by [Sunder Ali Khowaja](https://sander-ali.github.io) - [X](https://x.com/SunderAKhowaja) -[Github](https://github.com/sander-ali) -[Hugging Face](https://huggingface.co/SunderAli17)**
|
78 |
"""
|
@@ -93,7 +93,7 @@ theme = gr.themes.Soft(
|
|
93 |
# """
|
94 |
|
95 |
|
96 |
-
with gr.Blocks(title="
|
97 |
gr.Markdown(_MARKDOWN_)
|
98 |
with gr.Row():
|
99 |
with gr.Column():
|
@@ -107,27 +107,27 @@ with gr.Blocks(title="ToonMagev2", theme = "Yntec/HaleyCH_Theme_Orange") as SAK:
|
|
107 |
|
108 |
neg_prompt = gr.Textbox(label="Negative Prompt", value=DEFAULT_NEGATIVE_PROMPT)
|
109 |
with gr.Row():
|
110 |
-
id_scale = gr.Slider(label="ID scale", minimum=0, maximum=5, step=0.05, value=0.8, interactive=True)
|
111 |
mode = gr.Dropdown(label="mode", choices=['fidelity', 'extremely style'], value='fidelity')
|
112 |
id_mix = gr.Checkbox(
|
113 |
label="ID Mix (if you want to mix two ID image, please turn this on, otherwise, turn this off)",
|
114 |
value=False,
|
115 |
)
|
116 |
-
steps = gr.Slider(label="Steps", value=4, minimum=1, maximum=8, step=1)
|
117 |
-
seed = gr.Slider(
|
118 |
-
|
119 |
-
)
|
120 |
-
n_samples = gr.Slider(label="Num samples", value=2, minimum=1, maximum=4, step=1)
|
121 |
-
scale = gr.Slider(
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
)
|
128 |
-
with gr.Row():
|
129 |
-
|
130 |
-
|
131 |
|
132 |
gr.Markdown("## Examples")
|
133 |
example_inps = [
|
@@ -139,39 +139,39 @@ with gr.Blocks(title="ToonMagev2", theme = "Yntec/HaleyCH_Theme_Orange") as SAK:
|
|
139 |
]
|
140 |
gr.Examples(examples=example_inps, inputs=[prompt, face_image, mode], label='realistic')
|
141 |
|
142 |
-
example_inps = [
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
]
|
149 |
gr.Examples(examples=example_inps, inputs=[prompt, face_image, mode], label='painting style')
|
150 |
|
151 |
example_inps = [
|
152 |
[
|
153 |
-
'
|
154 |
-
'sample_img/
|
155 |
'fidelity',
|
156 |
]
|
157 |
]
|
158 |
gr.Examples(examples=example_inps, inputs=[prompt, face_image, mode], label='papercut style')
|
159 |
|
160 |
-
example_inps = [
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
]
|
167 |
-
gr.Examples(examples=example_inps, inputs=[prompt, face_image, mode], label='3d style')
|
168 |
-
example_inps = [
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
]
|
175 |
gr.Examples(examples=example_inps, inputs=[prompt, face_image, mode], label='portrait style')
|
176 |
example_inps = [
|
177 |
[
|
@@ -184,8 +184,8 @@ with gr.Blocks(title="ToonMagev2", theme = "Yntec/HaleyCH_Theme_Orange") as SAK:
|
|
184 |
|
185 |
example_inps = [
|
186 |
[
|
187 |
-
'
|
188 |
-
'sample_img/
|
189 |
'extremely style',
|
190 |
]
|
191 |
]
|
@@ -211,15 +211,15 @@ with gr.Blocks(title="ToonMagev2", theme = "Yntec/HaleyCH_Theme_Orange") as SAK:
|
|
211 |
supp_image1,
|
212 |
prompt,
|
213 |
neg_prompt,
|
214 |
-
id_scale,
|
215 |
mode,
|
216 |
id_mix,
|
217 |
-
steps,
|
218 |
-
seed,
|
219 |
-
n_samples,
|
220 |
-
scale,
|
221 |
-
H,
|
222 |
-
W
|
223 |
]
|
224 |
submit.click(fn=run, inputs=inps, outputs=[output, intermediate_output])
|
225 |
|
|
|
58 |
|
59 |
|
60 |
_MARKDOWN_ = """
|
61 |
+
<h2><b>This is the demo for DyCA-HiFi for Image to Identity Customization</b></h2>
|
62 |
|
63 |
**Tips**
|
64 |
|
|
|
72 |
|
73 |
Try out with different prompts using your image and do provide your feedback.
|
74 |
|
75 |
+
Note: Most of the images are generated using AI, therefore it does not resemble any living person.
|
76 |
|
77 |
**Demo by [Sunder Ali Khowaja](https://sander-ali.github.io) - [X](https://x.com/SunderAKhowaja) -[Github](https://github.com/sander-ali) -[Hugging Face](https://huggingface.co/SunderAli17)**
|
78 |
"""
|
|
|
93 |
# """
|
94 |
|
95 |
|
96 |
+
with gr.Blocks(title="DyCA-HiFi", theme = "Yntec/HaleyCH_Theme_Orange") as SAK:
|
97 |
gr.Markdown(_MARKDOWN_)
|
98 |
with gr.Row():
|
99 |
with gr.Column():
|
|
|
107 |
|
108 |
neg_prompt = gr.Textbox(label="Negative Prompt", value=DEFAULT_NEGATIVE_PROMPT)
|
109 |
with gr.Row():
|
110 |
+
# id_scale = gr.Slider(label="ID scale", minimum=0, maximum=5, step=0.05, value=0.8, interactive=True)
|
111 |
mode = gr.Dropdown(label="mode", choices=['fidelity', 'extremely style'], value='fidelity')
|
112 |
id_mix = gr.Checkbox(
|
113 |
label="ID Mix (if you want to mix two ID image, please turn this on, otherwise, turn this off)",
|
114 |
value=False,
|
115 |
)
|
116 |
+
# steps = gr.Slider(label="Steps", value=4, minimum=1, maximum=8, step=1)
|
117 |
+
# seed = gr.Slider(
|
118 |
+
# label="Seed", value=42, minimum=np.iinfo(np.uint32).min, maximum=np.iinfo(np.uint32).max, step=1
|
119 |
+
# )
|
120 |
+
# n_samples = gr.Slider(label="Num samples", value=2, minimum=1, maximum=4, step=1)
|
121 |
+
# scale = gr.Slider(
|
122 |
+
# label="CFG, recommend value range [1, 1.5], 1 will be faster ",
|
123 |
+
# value=1.2,
|
124 |
+
# minimum=1,
|
125 |
+
# maximum=1.5,
|
126 |
+
# step=0.1,
|
127 |
+
# )
|
128 |
+
# with gr.Row():
|
129 |
+
# H = gr.Slider(label="Height", value=1024, minimum=512, maximum=1280, step=64)
|
130 |
+
# W = gr.Slider(label="Width", value=768, minimum=512, maximum=1280, step=64)
|
131 |
|
132 |
gr.Markdown("## Examples")
|
133 |
example_inps = [
|
|
|
139 |
]
|
140 |
gr.Examples(examples=example_inps, inputs=[prompt, face_image, mode], label='realistic')
|
141 |
|
142 |
+
# example_inps = [
|
143 |
+
# [
|
144 |
+
# 'portrait, impressionist painting, loose brushwork, vibrant color, light and shadow play',
|
145 |
+
# 'sample_img/sample_img_test24.jpg',
|
146 |
+
# 'fidelity',
|
147 |
+
# ]
|
148 |
+
# ]
|
149 |
gr.Examples(examples=example_inps, inputs=[prompt, face_image, mode], label='painting style')
|
150 |
|
151 |
example_inps = [
|
152 |
[
|
153 |
+
'make the man look like gandalf from lord of the rings in a ghibli style',
|
154 |
+
'sample_img/test_image_4.jpg',
|
155 |
'fidelity',
|
156 |
]
|
157 |
]
|
158 |
gr.Examples(examples=example_inps, inputs=[prompt, face_image, mode], label='papercut style')
|
159 |
|
160 |
+
# example_inps = [
|
161 |
+
# [
|
162 |
+
# 'woman,cartoon,solo,Popmart Blind Box, Super Mario, 3d',
|
163 |
+
# 'sample_img/sample_img_test24.jpg',
|
164 |
+
# 'fidelity',
|
165 |
+
# ]
|
166 |
+
# ]
|
167 |
+
# gr.Examples(examples=example_inps, inputs=[prompt, face_image, mode], label='3d style')
|
168 |
+
# example_inps = [
|
169 |
+
# [
|
170 |
+
# 'portrait, pixar',
|
171 |
+
# 'sample_img/sample_img_test1.jpg',
|
172 |
+
# 'fidelity',
|
173 |
+
# ]
|
174 |
+
# ]
|
175 |
gr.Examples(examples=example_inps, inputs=[prompt, face_image, mode], label='portrait style')
|
176 |
example_inps = [
|
177 |
[
|
|
|
184 |
|
185 |
example_inps = [
|
186 |
[
|
187 |
+
'Make the character casually sip a cup of coffee standing in the moonlight in Ghibli style',
|
188 |
+
'sample_img/test_image_1.jpg',
|
189 |
'extremely style',
|
190 |
]
|
191 |
]
|
|
|
211 |
supp_image1,
|
212 |
prompt,
|
213 |
neg_prompt,
|
214 |
+
id_scale = 0.8,
|
215 |
mode,
|
216 |
id_mix,
|
217 |
+
steps = 4,
|
218 |
+
seed = 42,
|
219 |
+
n_samples = 2,
|
220 |
+
scale = 1.2,
|
221 |
+
H = 1024,
|
222 |
+
W = 768
|
223 |
]
|
224 |
submit.click(fn=run, inputs=inps, outputs=[output, intermediate_output])
|
225 |
|