mirror of
https://github.com/ostris/ai-toolkit.git
synced 2026-04-29 18:51:37 +00:00
Fixed some fringe cases for qwen image edit.
This commit is contained in:
@@ -165,6 +165,12 @@ class QwenImageEditPlusModel(QwenImageModel):
|
|||||||
# todo handle not caching text encoder
|
# todo handle not caching text encoder
|
||||||
if self.pipeline.text_encoder.device != self.device_torch:
|
if self.pipeline.text_encoder.device != self.device_torch:
|
||||||
self.pipeline.text_encoder.to(self.device_torch)
|
self.pipeline.text_encoder.to(self.device_torch)
|
||||||
|
|
||||||
|
if control_images is None:
|
||||||
|
raise ValueError("Missing control images for QwenImageEditPlusModel")
|
||||||
|
|
||||||
|
if not isinstance(control_images, List):
|
||||||
|
control_images = [control_images]
|
||||||
|
|
||||||
if control_images is not None and len(control_images) > 0:
|
if control_images is not None and len(control_images) > 0:
|
||||||
for i in range(len(control_images)):
|
for i in range(len(control_images)):
|
||||||
@@ -200,6 +206,8 @@ class QwenImageEditPlusModel(QwenImageModel):
|
|||||||
):
|
):
|
||||||
with torch.no_grad():
|
with torch.no_grad():
|
||||||
batch_size, num_channels_latents, height, width = latent_model_input.shape
|
batch_size, num_channels_latents, height, width = latent_model_input.shape
|
||||||
|
if self.vae.device != self.device_torch:
|
||||||
|
self.vae.to(self.device_torch)
|
||||||
|
|
||||||
control_image_res = VAE_IMAGE_SIZE
|
control_image_res = VAE_IMAGE_SIZE
|
||||||
if self.model_config.model_kwargs.get("match_target_res", False):
|
if self.model_config.model_kwargs.get("match_target_res", False):
|
||||||
|
|||||||
Reference in New Issue
Block a user