change size
Browse files
backend/lcm_text_to_image.py
CHANGED
@@ -238,11 +238,11 @@ class LCMTextToImage:
|
|
238 |
reshape: bool = False,
|
239 |
) -> Any:
|
240 |
guidance_scale = lcm_diffusion_setting.guidance_scale
|
241 |
-
w, h = lcm_diffusion_setting.init_image.size
|
242 |
-
newW = lcm_diffusion_setting.image_width
|
243 |
-
newH = int(h * newW / w)
|
244 |
-
lcm_diffusion_setting.image_height=newH
|
245 |
-
lcm_diffusion_setting.init_image = lcm_diffusion_setting.init_image.resize((newW, newH))
|
246 |
print("修改图像尺寸了",lcm_diffusion_setting.image_height,lcm_diffusion_setting.image_width)
|
247 |
img_to_img_inference_steps = lcm_diffusion_setting.inference_steps
|
248 |
check_step_value = int(
|
@@ -272,8 +272,8 @@ class LCMTextToImage:
|
|
272 |
|
273 |
self.pipeline.reshape(
|
274 |
batch_size=-1,
|
275 |
-
height=
|
276 |
-
width=
|
277 |
num_images_per_prompt=lcm_diffusion_setting.number_of_images,
|
278 |
)
|
279 |
self.pipeline.compile()
|
|
|
238 |
reshape: bool = False,
|
239 |
) -> Any:
|
240 |
guidance_scale = lcm_diffusion_setting.guidance_scale
|
241 |
+
# w, h = lcm_diffusion_setting.init_image.size
|
242 |
+
# newW = lcm_diffusion_setting.image_width
|
243 |
+
# newH = int(h * newW / w)
|
244 |
+
# lcm_diffusion_setting.image_height=newH
|
245 |
+
# lcm_diffusion_setting.init_image = lcm_diffusion_setting.init_image.resize((newW, newH))
|
246 |
print("修改图像尺寸了",lcm_diffusion_setting.image_height,lcm_diffusion_setting.image_width)
|
247 |
img_to_img_inference_steps = lcm_diffusion_setting.inference_steps
|
248 |
check_step_value = int(
|
|
|
272 |
|
273 |
self.pipeline.reshape(
|
274 |
batch_size=-1,
|
275 |
+
height=lcm_diffusion_setting.image_height,
|
276 |
+
width=lcm_diffusion_setting.image_width,
|
277 |
num_images_per_prompt=lcm_diffusion_setting.number_of_images,
|
278 |
)
|
279 |
self.pipeline.compile()
|