update
Browse files
backend/lcm_text_to_image.py
CHANGED
|
@@ -238,6 +238,11 @@ class LCMTextToImage:
|
|
| 238 |
reshape: bool = False,
|
| 239 |
) -> Any:
|
| 240 |
guidance_scale = lcm_diffusion_setting.guidance_scale
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 241 |
img_to_img_inference_steps = lcm_diffusion_setting.inference_steps
|
| 242 |
check_step_value = int(
|
| 243 |
lcm_diffusion_setting.inference_steps * lcm_diffusion_setting.strength
|
|
@@ -263,9 +268,7 @@ class LCMTextToImage:
|
|
| 263 |
print("Using OpenVINO")
|
| 264 |
if reshape and not self.is_openvino_init:
|
| 265 |
print("Reshape and compile,调整尺寸")
|
| 266 |
-
|
| 267 |
-
newW = lcm_diffusion_setting.image_width
|
| 268 |
-
newH = int(h * newW / w)
|
| 269 |
self.pipeline.reshape(
|
| 270 |
batch_size=-1,
|
| 271 |
height=newH,
|
|
|
|
| 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.init_image = lcm_diffusion_setting.init_image.resize((newW, newH))
|
| 245 |
+
print("修改图像尺寸了",newW,newH)
|
| 246 |
img_to_img_inference_steps = lcm_diffusion_setting.inference_steps
|
| 247 |
check_step_value = int(
|
| 248 |
lcm_diffusion_setting.inference_steps * lcm_diffusion_setting.strength
|
|
|
|
| 268 |
print("Using OpenVINO")
|
| 269 |
if reshape and not self.is_openvino_init:
|
| 270 |
print("Reshape and compile,调整尺寸")
|
| 271 |
+
|
|
|
|
|
|
|
| 272 |
self.pipeline.reshape(
|
| 273 |
batch_size=-1,
|
| 274 |
height=newH,
|