Skip to content

Fix Anima text encoder exports and standalone core denoising - #14943

Open
lucasruan1618 wants to merge 1 commit into
huggingface:mainfrom
lucasruan1618:fix-anima-modular-split-execution
Open

lucasruan1618 wants to merge 1 commit into
huggingface:mainfrom
lucasruan1618:fix-anima-modular-split-execution

Conversation

@lucasruan1618

Copy link
Copy Markdown

Fix Anima text encoder exports and standalone core denoising

What does this PR do?

Fixes two issues when running Anima's modular stages as separate pipelines.

AnimaTextEncoderStep produces eight Qwen/T5 conditioning tensors, but none is tagged with kwargs_type="denoiser_input_fields". Consequently, the documented split-pipeline workflow:

text_embeddings = text_encoder_pipeline(prompt="a cat").get_by_kwargs("denoiser_input_fields")
output = pipeline(**text_embeddings, num_inference_steps=2)

exports an empty dictionary and fails with Required input 'qwen_prompt_embeds' is missing. This PR adds the tag to all eight outputs, applying the same fix pattern as #14925.

Separately, AnimaCoreDenoiseStep does not require a VAE, but latent preparation reads vae_scale_factor, whose property accesses self.vae directly. Running that block standalone therefore raises AttributeError: 'AnimaModularPipeline' object has no attribute 'vae_scale_factor'. This PR allows the property to return its existing default of 8 when the VAE component is absent. Pipelines with a VAE continue to use its configured scale factor.

The source changes are eight output tags and one component lookup. Regression tests cover split execution with omitted, empty, and non-empty negative prompts, comparing generated images against the complete pipeline. A separate test passes encoded tensors by name to the standalone core denoiser and checks the resulting latent shape and finite values.

Validation

  • Anima modular suite: 57 passed, 5 skipped, including text-to-image and image-to-image tests.
  • Shared TestBlockKwargsTypeInputs tests: 4 passed.
  • make style, make fix-copies, make quality, and git diff --check: passed.
  • Regression cases reproduced both original failures before the fixes.

Tests use real components from hf-internal-testing/tiny-anima-modular-pipe. Production-size checkpoints were not tested.

Self-review notes

Reviewed against .ai/references/review-rules.md, code_style.md, modular.md, and testing.md, following .ai/skills/self-review.

  • Blocking issues: none.
  • Non-blocking issues: none.
  • Dead code: none introduced. Both changed paths are exercised through normal pipeline calls.
  • Documentation impact: the existing split-pipeline example becomes usable for Anima; no API or usage-doc changes are needed.
  • Verdict: READY. No unresolved findings.

Before submitting

  • AI assistance was used for implementation and testing.
  • Ran the self-review skill and included the final notes above.
  • Added regression tests and ran formatting and consistency checks.
  • Read the Coding with AI agents guide.
  • Read the contributor guidelines and review this description before submitting.

Who can review?

@yiyixuxu

@github-actions github-actions Bot added tests modular-pipelines size/M PR with diff < 200 LOC labels Oct 5, 2026
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Hi @lucasruan1618, thanks for the PR! It does not appear to link an issue it fixes. If this PR addresses an existing issue, please add a closing keyword (e.g. Fixes #1234) to the PR description so the issue is linked. See the contribution guide for more details. If this PR intentionally does not fix a tracked issue, a maintainer can add the no-issue-needed label to silence this reminder.

Please note that PRs without a linked issue are likely to be automatically closed 10 days after this notice.

Once the PR links an issue (or gets the no-issue-needed label), you can ignore this message — it stays here as a comment, but it no longer applies.

This branch has not been deployed

No deployments
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.

1 participant