Skip to content

z-image support npu#13689

Open
luren55 wants to merge 3 commits into
huggingface:mainfrom
Zhibin-Mo:main
Open

z-image support npu#13689
luren55 wants to merge 3 commits into
huggingface:mainfrom
Zhibin-Mo:main

Conversation

@luren55

@luren55 luren55 commented May 7, 2026

Copy link
Copy Markdown

What does this PR do?

Notice: Here is a PR extraction from #12979 to support z-image runs on NPU.

Issue: The Diffusers Z-Image pipeline fails on Ascend NPU because aclnnIndex lacks support for complex64. When freqs_cis is stored as a complex tensor on the NPU and then indexed, the call crashes.

Fix: Rework the RoPE frequency handling so that the NPU never needs to index complex64 tensors.

Running Environment:
I run this model base on cache-dit(https://github.com/vipshop/cache-dit/) which depends on diffusers to inference.

Command:
python3 generate.py zimage --model-path /home/weights/Z-Image-Turbo --attn _native_npu

Error before fixed:
image

Result after fixed:
image

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@github-actions github-actions Bot added models size/M PR with diff < 200 LOC labels May 7, 2026
@luren55

luren55 commented May 7, 2026

Copy link
Copy Markdown
Author

@yiyixuxu Hello, here is an extracion from the previous PR(#12979), can you review this PR? Thank you.

@luren55 luren55 mentioned this pull request May 8, 2026
6 tasks
@github-actions github-actions Bot added size/S PR with diff < 50 LOC and removed size/M PR with diff < 200 LOC labels May 8, 2026

@yiyixuxu yiyixuxu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@yiyixuxu

yiyixuxu commented May 8, 2026

Copy link
Copy Markdown
Collaborator

@bot style

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@yiyixuxu

yiyixuxu commented May 8, 2026

Copy link
Copy Markdown
Collaborator

@bot /style

@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

Style fix runs successfully without any file modified.

@yiyixuxu

yiyixuxu commented May 8, 2026

Copy link
Copy Markdown
Collaborator

can you run make fix-copies?

@luren55

luren55 commented May 10, 2026

Copy link
Copy Markdown
Author

done

@st7109

st7109 commented Jun 3, 2026

Copy link
Copy Markdown

hello, we share same issue for complex64, i think this is necessary to add use_real parameter to Z-Image. please check my MR, #13824

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants