Skip to content

Commit be7887c

Browse files
fix: support qwen-image finetune (t2i) (#1700)
Signed-off-by: Harsha Pasham <pashamharsha018@gmail.com>
1 parent 8730a75 commit be7887c

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

tests/unit_tests/flow_matching/test_qwen_image_adapter.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020
import torch
2121

2222
from nemo_automodel.components.flow_matching.adapters.base import FlowMatchingContext
23-
from nemo_automodel.components.flow_matching.adapters.qwen_image import QwenImageAdapter
24-
23+
from nemo_automodel.components.flow_matching.adapters.qwen_image import (
24+
QwenImageAdapter,
25+
)
2526

2627
# =============================================================================
2728
# TestQwenImageAdapterPackLatents
@@ -182,7 +183,8 @@ def test_2d_text_unsqueeze(self):
182183
noisy = torch.randn(1, 16, 8, 8)
183184
batch = {"text_embeddings": torch.randn(77, 2048)} # 2D
184185
ctx = self._make_context(
185-
noisy, batch,
186+
noisy,
187+
batch,
186188
timesteps=torch.tensor([500.0]),
187189
sigma=torch.tensor([0.5]),
188190
)

tools/diffusion/processors/qwen_image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def load_models(self, model_name: str, device: str) -> Dict[str, Any]:
6666
- tokenizer: Qwen2 tokenizer
6767
- text_encoder: Qwen2 text encoder
6868
"""
69-
from diffusers import AutoencoderKL, QwenImagePipeline
69+
from diffusers import QwenImagePipeline
7070

7171
logger.info("[Qwen-Image] Loading models from %s...", model_name)
7272

0 commit comments

Comments
 (0)