Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -125,6 +125,7 @@ tag_model.to(device, dtype=weight_dtype)
|
|
| 125 |
def process(
|
| 126 |
input_image: Image.Image,
|
| 127 |
user_prompt: str,
|
|
|
|
| 128 |
use_KDS: bool,
|
| 129 |
bandwidth: float,
|
| 130 |
num_particles: int,
|
|
@@ -179,7 +180,7 @@ def process(
|
|
| 179 |
guidance_scale=cfg_scale, conditioning_scale=1,
|
| 180 |
start_point='lr', start_steps=999,ram_encoder_hidden_states=ram_encoder_hidden_states,
|
| 181 |
latent_tiled_size=latent_tiled_size, latent_tiled_overlap=latent_tiled_overlap,
|
| 182 |
-
use_KDS=use_KDS, bandwidth=bandwidth, num_particles=num_particles
|
| 183 |
).images[0]
|
| 184 |
|
| 185 |
if True: # alpha<1.0:
|
|
@@ -213,6 +214,7 @@ with block:
|
|
| 213 |
input_image = gr.Image(type="pil")
|
| 214 |
num_particles = gr.Slider(label="Num of Partickes", minimum=1, maximum=16, step=1, value=10)
|
| 215 |
bandwidth = gr.Slider(label="Bandwidth", minimum=0.1, maximum=0.8, step=0.1, value=0.1)
|
|
|
|
| 216 |
use_KDS = gr.Checkbox(label="Use Kernel Density Steering")
|
| 217 |
run_button = gr.Button("Run")
|
| 218 |
with gr.Accordion("Options", open=True):
|
|
@@ -238,6 +240,24 @@ with block:
|
|
| 238 |
"",
|
| 239 |
False,
|
| 240 |
0.1,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 241 |
4,
|
| 242 |
"clean, high-resolution, 8k, best quality, masterpiece",
|
| 243 |
"dotted, noise, blur, lowres, oversmooth, longbody, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality",
|
|
@@ -255,6 +275,24 @@ with block:
|
|
| 255 |
True,
|
| 256 |
0.1,
|
| 257 |
4,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 258 |
"clean, high-resolution, 8k, best quality, masterpiece",
|
| 259 |
"dotted, noise, blur, lowres, oversmooth, longbody, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality",
|
| 260 |
50,
|
|
@@ -270,6 +308,7 @@ with block:
|
|
| 270 |
"",
|
| 271 |
True,
|
| 272 |
0.1,
|
|
|
|
| 273 |
16,
|
| 274 |
"clean, high-resolution, 8k, best quality, masterpiece",
|
| 275 |
"dotted, noise, blur, lowres, oversmooth, longbody, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality",
|
|
@@ -286,6 +325,7 @@ with block:
|
|
| 286 |
input_image,
|
| 287 |
user_prompt,
|
| 288 |
use_KDS,
|
|
|
|
| 289 |
bandwidth,
|
| 290 |
num_particles,
|
| 291 |
positive_prompt,
|
|
@@ -306,6 +346,7 @@ with block:
|
|
| 306 |
input_image,
|
| 307 |
user_prompt,
|
| 308 |
use_KDS,
|
|
|
|
| 309 |
bandwidth,
|
| 310 |
num_particles,
|
| 311 |
positive_prompt,
|
|
|
|
| 125 |
def process(
|
| 126 |
input_image: Image.Image,
|
| 127 |
user_prompt: str,
|
| 128 |
+
patch_size: int,
|
| 129 |
use_KDS: bool,
|
| 130 |
bandwidth: float,
|
| 131 |
num_particles: int,
|
|
|
|
| 180 |
guidance_scale=cfg_scale, conditioning_scale=1,
|
| 181 |
start_point='lr', start_steps=999,ram_encoder_hidden_states=ram_encoder_hidden_states,
|
| 182 |
latent_tiled_size=latent_tiled_size, latent_tiled_overlap=latent_tiled_overlap,
|
| 183 |
+
use_KDS=use_KDS, bandwidth=bandwidth, num_particles=num_particles, patch_size=patch_size,
|
| 184 |
).images[0]
|
| 185 |
|
| 186 |
if True: # alpha<1.0:
|
|
|
|
| 214 |
input_image = gr.Image(type="pil")
|
| 215 |
num_particles = gr.Slider(label="Num of Partickes", minimum=1, maximum=16, step=1, value=10)
|
| 216 |
bandwidth = gr.Slider(label="Bandwidth", minimum=0.1, maximum=0.8, step=0.1, value=0.1)
|
| 217 |
+
patch_size = gr.Slider(label="Patch Size", minimum=1, maximum=16, step=16, value=4)
|
| 218 |
use_KDS = gr.Checkbox(label="Use Kernel Density Steering")
|
| 219 |
run_button = gr.Button("Run")
|
| 220 |
with gr.Accordion("Options", open=True):
|
|
|
|
| 240 |
"",
|
| 241 |
False,
|
| 242 |
0.1,
|
| 243 |
+
16,
|
| 244 |
+
4,
|
| 245 |
+
"clean, high-resolution, 8k, best quality, masterpiece",
|
| 246 |
+
"dotted, noise, blur, lowres, oversmooth, longbody, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality",
|
| 247 |
+
50,
|
| 248 |
+
4,
|
| 249 |
+
7.5,
|
| 250 |
+
123,
|
| 251 |
+
320,
|
| 252 |
+
4,
|
| 253 |
+
1,
|
| 254 |
+
],
|
| 255 |
+
[
|
| 256 |
+
"preset/datasets/test_datasets/179.png",
|
| 257 |
+
"",
|
| 258 |
+
True,
|
| 259 |
+
0.1,
|
| 260 |
+
16,
|
| 261 |
4,
|
| 262 |
"clean, high-resolution, 8k, best quality, masterpiece",
|
| 263 |
"dotted, noise, blur, lowres, oversmooth, longbody, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality",
|
|
|
|
| 275 |
True,
|
| 276 |
0.1,
|
| 277 |
4,
|
| 278 |
+
4,
|
| 279 |
+
"clean, high-resolution, 8k, best quality, masterpiece",
|
| 280 |
+
"dotted, noise, blur, lowres, oversmooth, longbody, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality",
|
| 281 |
+
50,
|
| 282 |
+
4,
|
| 283 |
+
7.5,
|
| 284 |
+
123,
|
| 285 |
+
320,
|
| 286 |
+
4,
|
| 287 |
+
1,
|
| 288 |
+
],
|
| 289 |
+
[
|
| 290 |
+
"preset/datasets/test_datasets/179.png",
|
| 291 |
+
"",
|
| 292 |
+
True,
|
| 293 |
+
0.1,
|
| 294 |
+
4,
|
| 295 |
+
1,
|
| 296 |
"clean, high-resolution, 8k, best quality, masterpiece",
|
| 297 |
"dotted, noise, blur, lowres, oversmooth, longbody, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality",
|
| 298 |
50,
|
|
|
|
| 308 |
"",
|
| 309 |
True,
|
| 310 |
0.1,
|
| 311 |
+
32,
|
| 312 |
16,
|
| 313 |
"clean, high-resolution, 8k, best quality, masterpiece",
|
| 314 |
"dotted, noise, blur, lowres, oversmooth, longbody, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality",
|
|
|
|
| 325 |
input_image,
|
| 326 |
user_prompt,
|
| 327 |
use_KDS,
|
| 328 |
+
patch_size,
|
| 329 |
bandwidth,
|
| 330 |
num_particles,
|
| 331 |
positive_prompt,
|
|
|
|
| 346 |
input_image,
|
| 347 |
user_prompt,
|
| 348 |
use_KDS,
|
| 349 |
+
patch_size,
|
| 350 |
bandwidth,
|
| 351 |
num_particles,
|
| 352 |
positive_prompt,
|