michaelj commited on
Commit
687c5b2
·
1 Parent(s): 2b5958f

change size

Browse files
Files changed (1) hide show
  1. backend/lcm_text_to_image.py +6 -3
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=lcm_diffusion_setting.image_height,
269
- width=lcm_diffusion_setting.image_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()