[New model] Qwen-Image-2.1 support (rebase + review follow-ups) (#8099)

Signed-off-by: NumberWan <wantszkin2003@gmail.com>
Signed-off-by: SamitHuang <285365963@qq.com>
Signed-off-by: Samit <285365963@qq.com>
Co-authored-by: Isotr0py <Isotr0py@outlook.com>
Co-authored-by: Tianyu Guo <guoty9@mail2.sysu.edu.cn>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: SamitHuang <285365963@qq.com>
Co-authored-by: Gao Han <hgaoaf@connect.ust.hk>
This commit is contained in:
authored and GitHub committed 2026-10-07 21:23:59 +08:00
1 parent 8ef77be66e
commit 3dc35694b3
52 files changed
+8058 -136

No files matched your search

+23 -2
View File
@@ -271,7 +271,7 @@ def test_ltx_reference_image_size_policy(tmp_path, model_version: str, expected:
def test_reference_image_size_policy_threads_revision(monkeypatch: pytest.MonkeyPatch) -> None:
captured = {}
captured: dict[str, Any] = {}
def fake_policy(*, model, revision=None):
captured.update(model=model, revision=revision)
@@ -495,6 +495,27 @@ def test_bagel_image_to_image_prompt_builder() -> None:
assert result["negative_prompt"] == "ugly"
@pytest.mark.core_model
@pytest.mark.cpu
def test_qwen_image_21_image_to_image_prompt_builder() -> None:
dummy_image = Image.new("RGBA", (64, 64))
result = build_image_to_image_prompt(
"QwenImage21Pipeline",
prompt="make it dance",
negative_prompt="blurry",
input_image=dummy_image,
height=1024,
width=768,
)
assert result == {
"prompt": "make it dance",
"multi_modal_data": {"image": dummy_image},
"height": 1024,
"width": 768,
"negative_prompt": "blurry",
}
@pytest.mark.core_model
@pytest.mark.cpu
def test_unknown_pipeline_preserves_canonical_text_to_image_prompt() -> None:
@@ -785,7 +806,7 @@ def _patch_hunyuan_autotokenizer(monkeypatch: pytest.MonkeyPatch, tokenizer: obj
return tokenizer
fake_transformers = type(sys)("transformers")
fake_transformers.AutoTokenizer = _FakeAutoTokenizer
setattr(fake_transformers, "AutoTokenizer", _FakeAutoTokenizer)
monkeypatch.setitem(sys.modules, "transformers", fake_transformers)
return calls