poipiii
commited on
Commit
•
46b8b78
1
Parent(s):
64e0ab0
fix interpolation size
Browse files- pipeline.py +22 -20
pipeline.py
CHANGED
@@ -1185,23 +1185,25 @@ class StableDiffusionLongPromptWeightingPipeline(StableDiffusionPipeline):
|
|
1185 |
callback_steps=callback_steps,
|
1186 |
)
|
1187 |
image_tensor = torch.from_numpy(image.images[0])
|
1188 |
-
|
1189 |
-
|
1190 |
-
|
1191 |
-
|
1192 |
-
|
1193 |
-
|
1194 |
-
|
1195 |
-
|
1196 |
-
|
1197 |
-
|
1198 |
-
|
1199 |
-
|
1200 |
-
|
1201 |
-
|
1202 |
-
|
1203 |
-
|
1204 |
-
|
1205 |
-
|
1206 |
-
|
1207 |
-
|
|
|
|
|
|
1185 |
callback_steps=callback_steps,
|
1186 |
)
|
1187 |
image_tensor = torch.from_numpy(image.images[0])
|
1188 |
+
image_tensor = torch.unsqueeze(
|
1189 |
+
image_tensor.reshape([3, height, width]), 0)
|
1190 |
+
|
1191 |
+
resized_image = torch.nn.functional.interpolate(
|
1192 |
+
image_tensor, size=(int(height*resize_scale), int(width*resize_scale)))
|
1193 |
+
|
1194 |
+
highres_image = self.__call__(prompt=prompt,
|
1195 |
+
negative_prompt=negative_prompt,
|
1196 |
+
image=resized_image,
|
1197 |
+
num_inference_steps=num_inference_steps_upscale,
|
1198 |
+
guidance_scale=guidance_scale,
|
1199 |
+
strength=strength,
|
1200 |
+
num_images_per_prompt=num_images_per_prompt,
|
1201 |
+
eta=eta,
|
1202 |
+
generator=generator,
|
1203 |
+
max_embeddings_multiples=max_embeddings_multiples,
|
1204 |
+
output_type=output_type,
|
1205 |
+
return_dict=return_dict,
|
1206 |
+
callback=callback,
|
1207 |
+
is_cancelled_callback=is_cancelled_callback,
|
1208 |
+
callback_steps=callback_steps,)
|
1209 |
+
return highres_image
|