Spaces:
Running
on
Zero
Running
on
Zero
arthur-qiu
commited on
Commit
·
5d4e5d9
1
Parent(s):
4da4f88
add turbo
Browse files
app.py
CHANGED
@@ -27,11 +27,9 @@ def infer_gpu_turbo(pipe, seed, prompt, negative_prompt, ddim_steps, guidance_sc
|
|
27 |
pipe = pipe.to("cuda")
|
28 |
generator = torch.Generator(device='cuda')
|
29 |
generator = generator.manual_seed(seed)
|
30 |
-
print('freeu starts')
|
31 |
if not disable_freeu:
|
32 |
register_free_upblock2d(pipe, b1=1.1, b2=1.2, s1=0.6, s2=0.4)
|
33 |
register_free_crossattn_upblock2d(pipe, b1=1.1, b2=1.2, s1=0.6, s2=0.4)
|
34 |
-
print('freeu ends')
|
35 |
result = pipe(prompt, negative_prompt=negative_prompt, generator=generator,
|
36 |
num_inference_steps=ddim_steps, guidance_scale=guidance_scale,
|
37 |
resolutions_list=resolutions_list, fast_mode=fast_mode, cosine_scale=cosine_scale,
|
@@ -69,11 +67,11 @@ def infer(prompt, output_size, ddim_steps, guidance_scale, cosine_scale, seed, o
|
|
69 |
[1024, 1024],
|
70 |
[2048, 2048]]
|
71 |
elif output_size == "1024 x 2048":
|
72 |
-
resolutions_list = [[256, 512]
|
73 |
[512, 1024],
|
74 |
[1024, 2048]]
|
75 |
elif output_size == "2048 x 1024":
|
76 |
-
resolutions_list = [[512, 256]
|
77 |
[1024, 512],
|
78 |
[2048, 1024]]
|
79 |
infer_gpu_part = infer_gpu_turbo
|
|
|
27 |
pipe = pipe.to("cuda")
|
28 |
generator = torch.Generator(device='cuda')
|
29 |
generator = generator.manual_seed(seed)
|
|
|
30 |
if not disable_freeu:
|
31 |
register_free_upblock2d(pipe, b1=1.1, b2=1.2, s1=0.6, s2=0.4)
|
32 |
register_free_crossattn_upblock2d(pipe, b1=1.1, b2=1.2, s1=0.6, s2=0.4)
|
|
|
33 |
result = pipe(prompt, negative_prompt=negative_prompt, generator=generator,
|
34 |
num_inference_steps=ddim_steps, guidance_scale=guidance_scale,
|
35 |
resolutions_list=resolutions_list, fast_mode=fast_mode, cosine_scale=cosine_scale,
|
|
|
67 |
[1024, 1024],
|
68 |
[2048, 2048]]
|
69 |
elif output_size == "1024 x 2048":
|
70 |
+
resolutions_list = [[256, 512],
|
71 |
[512, 1024],
|
72 |
[1024, 2048]]
|
73 |
elif output_size == "2048 x 1024":
|
74 |
+
resolutions_list = [[512, 256],
|
75 |
[1024, 512],
|
76 |
[2048, 1024]]
|
77 |
infer_gpu_part = infer_gpu_turbo
|