Skip to content

anima: remove and rewrite all code referencing ComfyUI - #123

Closed
ling0322 wants to merge 1 commit into
mainfrom
worktree-remove-comfyui
Closed

ling0322 wants to merge 1 commit into
mainfrom
worktree-remove-comfyui

Conversation

@ling0322

@ling0322 ling0322 commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Removes all code and text in the repository that references ComfyUI (GPL), and rewrites what used it. tools/anima_comfy.py, which ran ComfyUI to compute Anima's test tensors, is deleted and replaced by tools/anima_reference.py, a new MIT script that computes the same tensors with Apache-2.0 code. anima_exporter.py loses -comfyui, and the ComfyUI citations, quoted comments and code snippets in docs/anima.md, the add-anima-model skill, tools/requirements.txt and the comments in waifu/ are rewritten.

Why

libwaifu is MIT and must not depend on or port from copyleft code. Anima's test tensors were computed by importing ComfyUI at run time, and docs/anima.md quoted its source. A case-insensitive search for "comfy" across the tree now finds nothing.

What changed

  • tools/anima_reference.py loads the published weights with strict name checking, so a wrong tensor name is an error rather than a randomly initialized layer. It needs its own venv, tools/requirements-anima.txt.
  • waifu/tests/anima.rs: the decode test clamps the runtime's picture to [-1, 1] before comparing, since the new test tensors are clamped and the runtime leaves that to pixel conversion.
  • waifu/src/sdxl/sampler.rs: the test named after ComfyUI is now the_schedule_is_the_floor_of_the_steps_over_the_strength, with unchanged behaviour.

Measured

Relative RMSE of the Rust runtime against the new test tensors, Anima Turbo v1.1, on the code before this change (de01833) and after:

stage before after
Qwen3 hidden states 0.0039 0.0039
adapter context 0.0025 0.0025
one DiT velocity step 0.012 0.012
VAE decode 0.048 (unclamped, fails) 0.00069
anima / anima_pipeline / anima_tokenizer 6/7, 6/6, 3/3 7/7, 6/6, 3/3

A plain export from the old and new exporter is byte-identical: weights, manifest and both tokenizers. ./build/unittest and cargo test pass.

Still to know

  • The local anima-turbo-v11_test.safetensors fixture must be regenerated from .venv-anima (see the skill).
  • ComfyUI material remains in the repository's history.

🤖 Generated with Claude Code

Replace tools/anima_comfy.py, which ran ComfyUI (GPL) to produce the Anima
test tensors, with tools/anima_reference.py, which runs diffusers' own
AnimaTextConditioner, CosmosTransformer3DModel and AutoencoderKLQwenImage
(Apache-2.0) on the published weights with strict loading. The exporter's
-comfyui flag is gone; -test_output runs from a venv built from the new
tools/requirements-anima.txt (diffusers 0.41, transformers 5.19).

Every ComfyUI citation, quoted comment and code snippet is removed from
docs/anima.md, the add-anima-model skill, tools/requirements.txt and the
comments in waifu/src/anima/ and waifu/src/sdxl/sampler.rs.

The Rust Anima code was measured against diffusers on Anima Turbo v1.1:
text encoder 0.0039, adapter 0.0025, one DiT step 0.012, VAE decode
0.00069 relative RMSE. diffusers clamps a decode to [-1, 1] and the runtime
does not, so the decode test now clamps the runtime's picture first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ling0322 ling0322 changed the title anima: compute the reference with diffusers; remove ComfyUI anima: remove all code referencing ComfyUI; rewrite the reference on diffusers Oct 14, 2026
@ling0322 ling0322 changed the title anima: remove all code referencing ComfyUI; rewrite the reference on diffusers anima: remove and rewrite all code referencing ComfyUI Oct 14, 2026
@ling0322 ling0322 closed this Oct 14, 2026
@ling0322
ling0322 deleted the worktree-remove-comfyui branch October 24, 2026 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant