Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -155,7 +155,6 @@ def create_demo(args, model_name: str, device: str = "cuda" if torch.cuda.is_ava
|
|
| 155 |
offload: bool = False):
|
| 156 |
|
| 157 |
with gr.Blocks(theme="soft") as demo:
|
| 158 |
-
# HTML ์ฝ๋๋ with ๋ธ๋ก ์์ ๋ค์ฌ์ฐ๊ธฐ๋์ด์ผ ํฉ๋๋ค
|
| 159 |
gr.HTML(
|
| 160 |
"""
|
| 161 |
<div class='container' style='display:flex; justify-content:center; gap:12px;'>
|
|
@@ -170,18 +169,12 @@ def create_demo(args, model_name: str, device: str = "cuda" if torch.cuda.is_ava
|
|
| 170 |
"""
|
| 171 |
)
|
| 172 |
|
| 173 |
-
# ์ฌ๊ธฐ์ ์ถ๊ฐ Gradio ์ปดํฌ๋ํธ๋ค์ ๋ฃ์ ์ ์์ต๋๋ค
|
| 174 |
-
|
| 175 |
-
return demo
|
| 176 |
-
|
| 177 |
-
|
| 178 |
with gr.Row():
|
| 179 |
with gr.Column():
|
| 180 |
prompt = gr.Textbox(label="Prompt", value="portrait, color, cinematic")
|
| 181 |
id_image = gr.Image(label="ID Image")
|
| 182 |
id_weight = gr.Slider(0.0, 3.0, 1, step=0.05, label="id weight")
|
| 183 |
|
| 184 |
-
|
| 185 |
width = gr.Slider(256, 1536, 896, step=16, label="Width")
|
| 186 |
height = gr.Slider(256, 1536, 1152, step=16, label="Height")
|
| 187 |
num_steps = gr.Slider(1, 20, 20, step=1, label="Number of steps")
|
|
@@ -204,35 +197,33 @@ def create_demo(args, model_name: str, device: str = "cuda" if torch.cuda.is_ava
|
|
| 204 |
output_image = gr.Image(label="Generated Image")
|
| 205 |
seed_output = gr.Textbox(label="Used Seed")
|
| 206 |
intermediate_output = gr.Gallery(label='Output', elem_id="gallery", visible=args.dev)
|
| 207 |
-
# _CITE_ ๊ด๋ จ ๋ถ๋ถ ์ ๊ฑฐ
|
| 208 |
-
|
| 209 |
|
| 210 |
with gr.Row(), gr.Column():
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
|
| 237 |
generate_btn.click(
|
| 238 |
fn=generate_image,
|
|
|
|
| 155 |
offload: bool = False):
|
| 156 |
|
| 157 |
with gr.Blocks(theme="soft") as demo:
|
|
|
|
| 158 |
gr.HTML(
|
| 159 |
"""
|
| 160 |
<div class='container' style='display:flex; justify-content:center; gap:12px;'>
|
|
|
|
| 169 |
"""
|
| 170 |
)
|
| 171 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 172 |
with gr.Row():
|
| 173 |
with gr.Column():
|
| 174 |
prompt = gr.Textbox(label="Prompt", value="portrait, color, cinematic")
|
| 175 |
id_image = gr.Image(label="ID Image")
|
| 176 |
id_weight = gr.Slider(0.0, 3.0, 1, step=0.05, label="id weight")
|
| 177 |
|
|
|
|
| 178 |
width = gr.Slider(256, 1536, 896, step=16, label="Width")
|
| 179 |
height = gr.Slider(256, 1536, 1152, step=16, label="Height")
|
| 180 |
num_steps = gr.Slider(1, 20, 20, step=1, label="Number of steps")
|
|
|
|
| 197 |
output_image = gr.Image(label="Generated Image")
|
| 198 |
seed_output = gr.Textbox(label="Used Seed")
|
| 199 |
intermediate_output = gr.Gallery(label='Output', elem_id="gallery", visible=args.dev)
|
|
|
|
|
|
|
| 200 |
|
| 201 |
with gr.Row(), gr.Column():
|
| 202 |
+
gr.Markdown("## Examples")
|
| 203 |
+
example_inps = [
|
| 204 |
+
[
|
| 205 |
+
'a woman holding sign with glowing green text \"PuLID for FLUX\"',
|
| 206 |
+
'example_inputs/qw1.webp',
|
| 207 |
+
4, 4, 2680261499100305976, 1
|
| 208 |
+
],
|
| 209 |
+
[
|
| 210 |
+
'portrait, pixar',
|
| 211 |
+
'example_inputs/qw2.webp',
|
| 212 |
+
1, 4, 9445036702517583939, 1
|
| 213 |
+
],
|
| 214 |
+
]
|
| 215 |
+
gr.Examples(examples=example_inps, inputs=[prompt, id_image, start_step, guidance, seed, true_cfg],
|
| 216 |
+
label='fake CFG')
|
| 217 |
+
|
| 218 |
+
example_inps = [
|
| 219 |
+
[
|
| 220 |
+
'portrait, made of ice sculpture',
|
| 221 |
+
'example_inputs/qw3.webp',
|
| 222 |
+
1, 1, 3811899118709451814, 5
|
| 223 |
+
],
|
| 224 |
+
]
|
| 225 |
+
gr.Examples(examples=example_inps, inputs=[prompt, id_image, start_step, guidance, seed, true_cfg],
|
| 226 |
+
label='true CFG')
|
| 227 |
|
| 228 |
generate_btn.click(
|
| 229 |
fn=generate_image,
|