Extensions/comfyui-anyflow
ComfyUI Extension

comfyui-anyflow

AnyFlow endpoint-conditioned LoRA inference for ComfyUI

By SimpleTuner-io·Created 20 days ago·Updated 20 days ago· 0
SimpleTuner-io/ComfyUI-AnyFlow
Nodes2
On cloudLocal install
Categorysampling/custom_sampling/samplers, loaders/anyflow
Stars0
Updated20 days ago
Readme

ComfyUI-AnyFlow

Native AnyFlow inference nodes for ComfyUI. The initial implementation supports:

  • Anima
  • Ideogram 4
  • Wan 2.1 (T2V and I2V models using ComfyUI's WAN21 base)

AnyFlow adapters are not ordinary LoRAs. In addition to applying their LoRA weights, the loader patches the model's time-conditioning path so every denoiser call receives both ends of its current interval, t and r.

Installation

Clone this repository into ComfyUI/custom_nodes/ComfyUI-AnyFlow, then restart ComfyUI. Place AnyFlow adapter files in the normal ComfyUI/models/loras directory.

No additional Python packages are required.

Workflow

An end-to-end Anima example is included at example_workflows/anima_anyflow_t2i.json. It expects the official Anima base transformer, Qwen 3 0.6B text encoder, Qwen Image VAE, and checkpoint-1250/pytorch_lora_weights.safetensors from bghira/anima-anyflow-e621-dmd-v5. The adjacent _api.json file is the same graph in ComfyUI API format for scripted execution.

Place the example assets at these paths relative to ComfyUI:

  • models/diffusion_models/anima-base-v1.0.safetensors
  • models/text_encoders/qwen_3_06b_base.safetensors
  • models/vae/qwen_image_vae.safetensors
  • models/loras/pytorch_lora_weights.safetensors
  1. Load the base diffusion model normally.
  2. Pass its MODEL through AnyFlow LoRA Loader.
  3. Use AnyFlow Euler Sampler as the sampler input of SamplerCustom or SamplerCustomAdvanced.
  4. Build SIGMAS with the normal ComfyUI scheduler nodes appropriate for the base model.

The AnyFlow sampler uses the supplied sigma schedule verbatim. At step i, it passes sigmas[i + 1] as the interval endpoint and performs the same Euler latent update as ComfyUI's standard Euler sampler. There is no separate AnyFlow integration formula.

The loader reads flowmap_gate_value and flowmap_deltatime_type from safetensors adapter metadata when present. Older adapters without that metadata use the SimpleTuner defaults gate=0.25 and deltatime_type="r"; this is logged as a warning. The gate is training configuration, not an inference-strength control.

The linked anima-anyflow-e621-dmd-v5 checkpoints are legacy adapters without endpoint metadata, so the defaults are expected for those files.

Current limits

  • Use the supplied deterministic Euler sampler. Multi-evaluation solvers do not have one unambiguous destination endpoint for every model evaluation.
  • One AnyFlow adapter can be installed on a model branch at a time. Ordinary LoRAs may be applied after the AnyFlow loader as usual.
  • This first release intentionally rejects unsupported model families instead of treating an AnyFlow adapter as a normal LoRA.

The architecture-specific code is isolated to the time-embedding wrappers and LoRA key aliases so additional AnyFlow model families can be added without changing the sampler.