change size
Browse files
backend/lcm_text_to_image.py
CHANGED
@@ -262,11 +262,14 @@ class LCMTextToImage:
|
|
262 |
if is_openvino_pipe:
|
263 |
print("Using OpenVINO")
|
264 |
if reshape and not self.is_openvino_init:
|
265 |
-
print("Reshape and compile")
|
|
|
|
|
|
|
266 |
self.pipeline.reshape(
|
267 |
batch_size=-1,
|
268 |
-
height=
|
269 |
-
width=
|
270 |
num_images_per_prompt=lcm_diffusion_setting.number_of_images,
|
271 |
)
|
272 |
self.pipeline.compile()
|
|
|
262 |
if is_openvino_pipe:
|
263 |
print("Using OpenVINO")
|
264 |
if reshape and not self.is_openvino_init:
|
265 |
+
print("Reshape and compile,调整尺寸")
|
266 |
+
w, h = lcm_diffusion_setting.init_image.size
|
267 |
+
newW = lcm_diffusion_setting.image_width
|
268 |
+
newH = int(h * newW / w)
|
269 |
self.pipeline.reshape(
|
270 |
batch_size=-1,
|
271 |
+
height=newH,
|
272 |
+
width=newW,
|
273 |
num_images_per_prompt=lcm_diffusion_setting.number_of_images,
|
274 |
)
|
275 |
self.pipeline.compile()
|