Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -81,18 +81,20 @@ def generate(prompt,
|
|
81 |
images = []
|
82 |
high_scale = scale
|
83 |
low_scale = -1 * scale
|
|
|
84 |
for i in progress.tqdm(range(interm_steps), desc="Generating images"):
|
85 |
-
print(f"The value of i is: {
|
86 |
print(f"The value of low_scale is: {low_scale}")
|
87 |
print(f"The value of high_scale is: {high_scale}")
|
88 |
print(f"The value of interm_steps is: {interm_steps}")
|
89 |
-
cur_scale = low_scale + (high_scale - low_scale) *
|
90 |
image = clip_slider.generate(prompt,
|
91 |
width=768,
|
92 |
height=768,
|
93 |
guidance_scale=guidance_scale,
|
94 |
scale=cur_scale, seed=seed, num_inference_steps=steps, avg_diff=avg_diff)
|
95 |
images.append(image)
|
|
|
96 |
canvas = Image.new('RGB', (256*interm_steps, 256))
|
97 |
for i, im in enumerate(images):
|
98 |
canvas.paste(im.resize((256,256)), (256 * i, 0))
|
|
|
81 |
images = []
|
82 |
high_scale = scale
|
83 |
low_scale = -1 * scale
|
84 |
+
counter = 0
|
85 |
for i in progress.tqdm(range(interm_steps), desc="Generating images"):
|
86 |
+
print(f"The value of i is: {counter}")
|
87 |
print(f"The value of low_scale is: {low_scale}")
|
88 |
print(f"The value of high_scale is: {high_scale}")
|
89 |
print(f"The value of interm_steps is: {interm_steps}")
|
90 |
+
cur_scale = low_scale + (high_scale - low_scale) * counter / (interm_steps - 1)
|
91 |
image = clip_slider.generate(prompt,
|
92 |
width=768,
|
93 |
height=768,
|
94 |
guidance_scale=guidance_scale,
|
95 |
scale=cur_scale, seed=seed, num_inference_steps=steps, avg_diff=avg_diff)
|
96 |
images.append(image)
|
97 |
+
counter+=1
|
98 |
canvas = Image.new('RGB', (256*interm_steps, 256))
|
99 |
for i, im in enumerate(images):
|
100 |
canvas.paste(im.resize((256,256)), (256 * i, 0))
|