Commit
•
6c78f11
1
Parent(s):
5a322c5
Update app.py
Browse files
app.py
CHANGED
@@ -150,7 +150,7 @@ def txt_to_img(prompt, neg_prompt, guidance, steps, width, height, generator,sup
|
|
150 |
generator = generator).images
|
151 |
pipe=pipe.to("cpu")
|
152 |
upscaler=upscaler.to("cuda")
|
153 |
-
|
154 |
prompt=prompt,
|
155 |
negative_prompt = neg_prompt,
|
156 |
image=low_res_latents,
|
@@ -158,11 +158,9 @@ def txt_to_img(prompt, neg_prompt, guidance, steps, width, height, generator,sup
|
|
158 |
guidance_scale=0,
|
159 |
output_type="latent",
|
160 |
generator=generator,
|
161 |
-
)
|
162 |
pipe=pipe.to("cuda")
|
163 |
upscaler=upscaler.to("cpu")
|
164 |
-
with torch.no_grad():
|
165 |
-
result = pipe.decode_latents(latents)
|
166 |
else:
|
167 |
result = pipe(
|
168 |
prompt,
|
|
|
150 |
generator = generator).images
|
151 |
pipe=pipe.to("cpu")
|
152 |
upscaler=upscaler.to("cuda")
|
153 |
+
result = upscaler(
|
154 |
prompt=prompt,
|
155 |
negative_prompt = neg_prompt,
|
156 |
image=low_res_latents,
|
|
|
158 |
guidance_scale=0,
|
159 |
output_type="latent",
|
160 |
generator=generator,
|
161 |
+
)
|
162 |
pipe=pipe.to("cuda")
|
163 |
upscaler=upscaler.to("cpu")
|
|
|
|
|
164 |
else:
|
165 |
result = pipe(
|
166 |
prompt,
|