Text-to-Image
Diffusers
English
Chinese
anyflow2
lora
diffusion-distillation
text-to-video
audio-video-generation
reference-conditioned-generation
Run this model with HF Jobs
Run guyuchao/AnyFlow2-LoRA-Collections on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/guyuchao/AnyFlow2-LoRA-Collections. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/guyuchao/AnyFlow2-LoRA-Collections on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use guyuchao/AnyFlow2-LoRA-Collections with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use guyuchao/AnyFlow2-LoRA-Collections with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("Wan-AI/Wan2.1-T2V-14B-Diffusers", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("guyuchao/AnyFlow2-LoRA-Collections") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
Commit ·
8abc42a
0
Parent(s):
Initial AnyFlow 2.0 LoRA release
Browse filesFiles changed (13)
- .gitattributesAdded+35
- FLUX.1-Dev/AnyFlow2-FLUX.1-Dev-4step.ptAdded+3
- FLUX.1-Dev/inference.ymlAdded+56
- FLUX.3-Klevin-Base/AnyFlow2-FLUX.3-Klevin-Base-4step.ptAdded+3
- FLUX.3-Klevin-Base/inference.ymlAdded+57
- H3-Ref2VA-33B/AnyFlow2-H3-Ref2VA-33B-4step.ptAdded+3
- H3-Ref2VA-33B/inference.ymlAdded+71
- H3-T2VA-33B/AnyFlow2-H3-T2VA-33B-4step.ptAdded+3
- H3-T2VA-33B/inference.ymlAdded+72
- LICENSEAdded+201
- README.mdAdded+164
- Wan2.1-T2V-14B/AnyFlow2-Wan2.1-T2V-14B-4step.ptAdded+3
- Wan2.1-T2V-14B/inference.ymlAdded+63
1234567891011121314151617181920212223242526272829303132333435*.7z filter=lfs diff=lfs merge=lfs -text*.arrow filter=lfs diff=lfs merge=lfs -text*.bin filter=lfs diff=lfs merge=lfs -text*.bz2 filter=lfs diff=lfs merge=lfs -text*.ckpt filter=lfs diff=lfs merge=lfs -text*.ftz filter=lfs diff=lfs merge=lfs -text*.gz filter=lfs diff=lfs merge=lfs -text*.h5 filter=lfs diff=lfs merge=lfs -text*.joblib filter=lfs diff=lfs merge=lfs -text*.lfs.* filter=lfs diff=lfs merge=lfs -text*.mlmodel filter=lfs diff=lfs merge=lfs -text*.model filter=lfs diff=lfs merge=lfs -text*.msgpack filter=lfs diff=lfs merge=lfs -text*.npy filter=lfs diff=lfs merge=lfs -text*.npz filter=lfs diff=lfs merge=lfs -text*.onnx filter=lfs diff=lfs merge=lfs -text*.ot filter=lfs diff=lfs merge=lfs -text*.parquet filter=lfs diff=lfs merge=lfs -text*.pb filter=lfs diff=lfs merge=lfs -text*.pickle filter=lfs diff=lfs merge=lfs -text*.pkl filter=lfs diff=lfs merge=lfs -text*.pt filter=lfs diff=lfs merge=lfs -text*.pth filter=lfs diff=lfs merge=lfs -text*.rar filter=lfs diff=lfs merge=lfs -text*.safetensors filter=lfs diff=lfs merge=lfs -textsaved_model/**/* filter=lfs diff=lfs merge=lfs -text*.tar.* filter=lfs diff=lfs merge=lfs -text*.tar filter=lfs diff=lfs merge=lfs -text*.tflite filter=lfs diff=lfs merge=lfs -text*.tgz filter=lfs diff=lfs merge=lfs -text*.wasm filter=lfs diff=lfs merge=lfs -text*.xz filter=lfs diff=lfs merge=lfs -text*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text123version https://git-lfs.github.com/spec/v1oid sha256:2a50df30c760c52bbbde75851588d46de0fe9a478bca072a985b0145de3067f8size 12705976111234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556name: test_flux1_anyflow2_datafree_lr5e-5_1k_b32mode: evalmanual_seed: 0mixed_precision: true
# dataset and data loader settingsdatasets: sample: type: PromptDataset prompt_path: assets/validation/flux/eval_caption_t2i.json
models: transformer_cfg: model_name: experiments/pretrained_models/FLUX.1-dev model_type: Flux1AnyFlow2Transformer2DModel attn_backend: flash enable_gradient_checkpoint: true guidance_embedding: 3.5 lora_config: lora_rank: 256 lora_alpha: 256 target_module_name: ["ff", "proj_mlp", "proj_out", "time_text_embed.timestep_embedder", "norm_out.linear"] param_names_to_optimize: ["lora_A", "lora_B"] continuous_basis_cfg: num_horizon_basis: 128 shift: 3.2 pretrained_path: experiments/pretrained_models/AnyFlow2-LoRA-Collections/FLUX.1-Dev/AnyFlow2-FLUX.1-Dev-4step.pt pretrained_weight: ema pretrained_type: lora text_encoder_cfg: max_sequence_length: 512 vae_cfg: load: true scheduler_cfg: shift: 3.2 distill_cfg: {}
# pathpath: pretrain_network: ~
# inference entry pointtrain: train_pipeline: Flux1AnyFlow2Trainer
# validation settingsval: val_pipeline: Flux1AnyFlow2Pipeline skip_first_eval: true sample_freq: 500 eval_freq: 500 sample_cfg: height: 1024 width: 1024 seed: [0, 1] num_inference_steps: [4]123version https://git-lfs.github.com/spec/v1oid sha256:c10ccee838f6d1f006134816c1cf4db76c6d6e1ca79092e0bf6ced6ff5ba9587size 1015242795123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657name: test_flux3_anyflow2_datafree_lr5e-5_5k_b32mode: evalmanual_seed: 0mixed_precision: true
# dataset and data loader settingsdatasets: sample: type: PromptDataset prompt_path: assets/validation/flux/eval_caption_t2i.json
models: transformer_cfg: model_name: experiments/pretrained_models/flux-3-image-klein-base model_type: Flux3AnyFlow2Transformer2DModel attn_backend: flash enable_gradient_checkpoint: true lora_config: lora_rank: 256 lora_alpha: 256 target_module_name: all-linear exclude_modules: '.*(image_cond|txt|timestep_embedder|context_embedder).*' param_names_to_optimize: ["lora_A", "lora_B"] continuous_basis_cfg: num_horizon_basis: 128 shift: 6.93 pretrained_path: experiments/pretrained_models/AnyFlow2-LoRA-Collections/FLUX.3-Klevin-Base/AnyFlow2-FLUX.3-Klevin-Base-4step.pt pretrained_weight: ema pretrained_type: lora text_encoder_cfg: prompt_upsampler: model_name: experiments/pretrained_models/flux-3-image-klein-pup vae_cfg: load: true scheduler_cfg: shift: 6.93 distill_cfg: {}
# pathpath: pretrain_network: ~
# inference entry pointtrain: train_pipeline: Flux3AnyFlow2Trainer
# validation settingsval: val_pipeline: Flux3AnyFlow2Pipeline skip_first_eval: true sample_freq: 500 eval_freq: 500 sample_cfg: height: 1024 width: 1024 seed: [0, 1] num_inference_steps: [4]123version https://git-lfs.github.com/spec/v1oid sha256:e5ece99e7dfafa23cffa0cb87f5361f60b48ba6cde1504331901546d08f22e09size 27813194491234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071name: test_h3_ref2va_anyflow2_datafree_124f_768x1344_lr5e-5_1k_b16mode: evalmanual_seed: 0mixed_precision: true
# dataset and data loader settingsdatasets: sample: type: Ref2VADataset prompt_path: assets/validation/h3/minimax_h3_ref2va_prompts.json
models: transformer_cfg: model_name: experiments/pretrained_models/MiniMax-H3 subfolder: transformer_ref model_type: MiniMaxH3AnyFlow2Transformer3DModel enable_gradient_checkpoint: true lora_config: lora_rank: 256 lora_alpha: 256 target_module_name: ["attn", "ff", "proj_out"] param_names_to_optimize: ["lora_A", "lora_B"] continuous_basis_cfg: num_horizon_basis: 128 video_shift: 12.0 audio_shift: 3.0 pretrained_path: experiments/pretrained_models/AnyFlow2-LoRA-Collections/H3-Ref2VA-33B/AnyFlow2-H3-Ref2VA-33B-4step.pt pretrained_weight: ema pretrained_type: lora text_encoder_cfg: text_encoder_layer: 50 drop_text_ratio: 0.0 negative_prompt: assets/negative_prompts/h3.json vae_cfg: load: true scheduler_cfg: shift: 12.0 final_step_size_scale: 0.6 audio_scheduler_cfg: shift: 3.0 final_step_size_scale: 0.6 audio_cfg: fps: 24 channels: 2 latents_per_second: 40 loss_weight: 1.0 distill_cfg: {}
# pathpath: pretrain_network: ~
# inference entry pointtrain: train_pipeline: MinMaxH3Ref2VAAnyFlow2Trainer
# validation settingsval: val_pipeline: MiniMaxH3AnyFlow2Ref2VAPipeline skip_first_eval: true sample_freq: 100 eval_freq: 999999 sample_cfg: height: 768 width: 1344 num_frames: 124 fps: 24 seed: [0, 1] num_inference_steps: [4] output_type: pil
123version https://git-lfs.github.com/spec/v1oid sha256:07fc4300af9fc75d5a6635cec7b14c92a313a3336a5da112137deab6121fac78size 2781318181123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172name: test_h3_anyflow2_datafree_124f_768x1344_lr5e-5_1k_b16mode: evalmanual_seed: 0mixed_precision: true
# dataset and data loader settingsdatasets: sample: type: PromptDataset prompt_path: assets/validation/h3/minimax_h3_t2va_prompts.json preprocess_cfg: height: 768 width: 1344
models: transformer_cfg: model_name: experiments/pretrained_models/MiniMax-H3 model_type: MiniMaxH3AnyFlow2Transformer3DModel enable_gradient_checkpoint: true lora_config: lora_rank: 256 lora_alpha: 256 target_module_name: ["attn", "ff", "proj_out"] param_names_to_optimize: ["lora_A", "lora_B"] continuous_basis_cfg: num_horizon_basis: 128 video_shift: 12.0 audio_shift: 3.0 pretrained_path: experiments/pretrained_models/AnyFlow2-LoRA-Collections/H3-T2VA-33B/AnyFlow2-H3-T2VA-33B-4step.pt pretrained_weight: ema pretrained_type: lora text_encoder_cfg: text_encoder_layer: 50 drop_text_ratio: 0.0 negative_prompt: assets/negative_prompts/h3.json vae_cfg: load: true scheduler_cfg: shift: 12.0 final_step_size_scale: 0.6 audio_scheduler_cfg: shift: 3.0 final_step_size_scale: 0.6 audio_cfg: fps: 24 channels: 2 latents_per_second: 40 loss_weight: 1.0 distill_cfg: {}
# pathpath: pretrain_network: ~
# inference entry pointtrain: train_pipeline: MinMaxH3AnyFlow2Trainer
# validation settingsval: val_pipeline: MiniMaxH3AnyFlow2T2VAPipeline skip_first_eval: true sample_freq: 100 eval_freq: 999999 sample_cfg: height: 768 width: 1344 seed: [0, 1] num_inference_steps: [4] num_frames: 124 fps: 24 output_type: pil123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
Copyright [2025] [NVIDIA]
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164---license: apache-2.0language:- en- zhbase_model:- black-forest-labs/FLUX.1-dev- black-forest-labs/flux-3-image-klein-base- Wan-AI/Wan2.1-T2V-14B-Diffusers- MiniMaxAI/MiniMax-H3library_name: diffuserstags:- anyflow2- lora- diffusion-distillation- text-to-image- text-to-video- audio-video-generation- reference-conditioned-generation---
# AnyFlow 2.0 LoRA Collections
<p align="center"> 🖥️ <a href="https://github.com/NVlabs/AnyFlow">Code</a> | 📑 <a href="https://arxiv.org/abs/2612.05524">Paper</a> | 🌐 <a href="https://nvlabs.github.io/AnyFlow/2.0/">Website</a> | 🎬 <a href="https://www.youtube.com/watch?v=BZtCBaqqO4s">Video</a> | 🤗 <a href="https://huggingface.co/guyuchao/AnyFlow2-LoRA-Collections">Models</a></p>
-----
**AnyFlow 2.0: Large-Scale Video Diffusion Distillation with Distributional Trajectory Regression**
AnyFlow 2.0 distills large diffusion models through **distributional trajectory regression (DTR)**. A continuous curvature head represents velocities inside each sampling transition, allowing trajectory regression and distribution matching to train the same intermediate student trajectory. A parameterized fake-score model supplies distribution feedback that distinguishes the source intervals.
This collection provides five BF16 EMA LoRA adapters for image, video, and audio-video generation. The supplied inference configurations use **4 sampling steps**.

*Performance overview from the [AnyFlow 2.0 project page](https://nvlabs.github.io/AnyFlow/2.0/). The figure covers the paper's six tasks; this collection contains the five bidirectional adapters listed below.*
## Video Demos
<div align="center"> <video width="80%" autoplay loop muted playsinline controls> <source src="https://nvlabs.github.io/AnyFlow/2.0/assets/showcase/demo.mp4" type="video/mp4"> Your browser does not support the video tag. </video></div>
## Released Models
| Model | Task | Base model | Download || --- | --- | --- | --- || FLUX.1 Dev | Text to image | [black-forest-labs/FLUX.1-dev](https://huggingface.co/black-forest-labs/FLUX.1-dev) | [LoRA](FLUX.1-Dev/AnyFlow2-FLUX.1-Dev-4step.pt) · [Config](FLUX.1-Dev/inference.yml) || FLUX.3 Klein Base | Text to image | [black-forest-labs/flux-3-image-klein-base](https://huggingface.co/black-forest-labs/flux-3-image-klein-base) | [LoRA](FLUX.3-Klevin-Base/AnyFlow2-FLUX.3-Klevin-Base-4step.pt) · [Config](FLUX.3-Klevin-Base/inference.yml) || Wan2.1 T2V 14B | Text to video | [Wan-AI/Wan2.1-T2V-14B-Diffusers](https://huggingface.co/Wan-AI/Wan2.1-T2V-14B-Diffusers) | [LoRA](Wan2.1-T2V-14B/AnyFlow2-Wan2.1-T2V-14B-4step.pt) · [Config](Wan2.1-T2V-14B/inference.yml) || H3 T2VA 33B | Text to video and audio | [MiniMaxAI/MiniMax-H3](https://huggingface.co/MiniMaxAI/MiniMax-H3) | [LoRA](H3-T2VA-33B/AnyFlow2-H3-T2VA-33B-4step.pt) · [Config](H3-T2VA-33B/inference.yml) || H3 Ref2VA 33B | Reference to video and audio | [MiniMaxAI/MiniMax-H3](https://huggingface.co/MiniMaxAI/MiniMax-H3) | [LoRA](H3-Ref2VA-33B/AnyFlow2-H3-Ref2VA-33B-4step.pt) · [Config](H3-Ref2VA-33B/inference.yml) |
H3 generates video with a stereo audio track. FLUX.3 also uses the official [prompt upsampler](https://huggingface.co/black-forest-labs/flux-3-image-klein-pup).
The adapters use the AnyFlow 2.0 model classes and schedulers. Load them with the corresponding base model and the provided configuration in the [AnyFlow codebase](https://github.com/NVlabs/AnyFlow).
## Quickstart
### 1. Set Up the Environment
From the AnyFlow 2.0 code repository root:
```bashconda create -n anyflow2 python=3.11 -yconda activate anyflow2pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128pip install -r requirements.txt --no-build-isolation```
### 2. Download the Models
Download this collection into the directory used by the demo and configs:
```bashhf download guyuchao/AnyFlow2-LoRA-Collections --local-dir experiments/pretrained_models/AnyFlow2-LoRA-Collections```
To download just one adapter and its config, select its folder:
```bashhf download guyuchao/AnyFlow2-LoRA-Collections --include "Wan2.1-T2V-14B/*" --local-dir experiments/pretrained_models/AnyFlow2-LoRA-Collections```
Download the base model for the task you want to run. FLUX.3 needs both its base model and prompt upsampler:
```bash# FLUX.1hf download black-forest-labs/FLUX.1-dev --local-dir experiments/pretrained_models/FLUX.1-dev
# FLUX.3hf download black-forest-labs/flux-3-image-klein-base --local-dir experiments/pretrained_models/flux-3-image-klein-basehf download black-forest-labs/flux-3-image-klein-pup --local-dir experiments/pretrained_models/flux-3-image-klein-pup
# Wan2.1hf download Wan-AI/Wan2.1-T2V-14B-Diffusers --local-dir experiments/pretrained_models/Wan2.1-T2V-14B-Diffusers
# H3: shared base model for T2VA and Ref2VAhf download MiniMaxAI/MiniMax-H3 --local-dir experiments/pretrained_models/MiniMax-H3```
For gated repositories, sign in with `hf auth login` and obtain access from the corresponding model page.
### 3. Generate One Example
Each demo uses an example from the code repository's `assets/validation/` directory and seed **1**:
```bashpython demo.py task=flux1_t2ipython demo.py task=flux3_t2ipython demo.py task=wan_t2vpython demo.py task=h3_t2vapython demo.py task=h3_ref2va```
The examples include a Hanfu tea illustration for FLUX, a Jeep scene for Wan and H3 T2VA, and two reference images for H3 Ref2VA. Outputs are saved under `results/demo/`. Set `save_dir=/path/to/outputs` to change the destination.
### 4. Run the Full Sample Set
Each `inference.yml` matches its corresponding config under `options/test/` in the code repository. Run it from the code repository root:
```bashtorchrun --standalone --nproc_per_node=4 -m far.main config_path=experiments/pretrained_models/AnyFlow2-LoRA-Collections/FLUX.1-Dev/inference.ymltorchrun --standalone --nproc_per_node=4 -m far.main config_path=experiments/pretrained_models/AnyFlow2-LoRA-Collections/FLUX.3-Klevin-Base/inference.ymltorchrun --standalone --nproc_per_node=4 -m far.main config_path=experiments/pretrained_models/AnyFlow2-LoRA-Collections/Wan2.1-T2V-14B/inference.ymltorchrun --standalone --nproc_per_node=4 -m far.main config_path=experiments/pretrained_models/AnyFlow2-LoRA-Collections/H3-T2VA-33B/inference.ymltorchrun --standalone --nproc_per_node=4 -m far.main config_path=experiments/pretrained_models/AnyFlow2-LoRA-Collections/H3-Ref2VA-33B/inference.yml```
Set `--nproc_per_node` to the number of GPUs available for inference; model weights are sharded across those GPUs. The configs process the complete sample set from `assets/validation/` with seeds **0 and 1**. Ref2VA loads each sample's metadata and reference media from the same assets directory. Keep these assets when running the configs.
Generated samples and test logs are written under `results/<name>/`, where `name` comes from the YAML. Change `models.transformer_cfg.model_name` for a different local base-model location or `models.transformer_cfg.pretrained_path` for a different local adapter location. The configs load the adapter's `ema` weights with `pretrained_type: lora`.
## License
The LoRA adapter weights in this collection are released under the [Apache License 2.0](LICENSE).
The base models are distributed separately under their respective licenses. Refer to the base-model cards linked above for their terms.
## Citation
If you use AnyFlow 2.0 in your research, please cite:
```bibtex@article{gu2026anyflow2, title={AnyFlow 2.0: Large-Scale Video Diffusion Distillation with Distributional Trajectory Regression}, author={Gu, Yuchao and Fang, Guian and Song, Yiren and Wu, Junyi and Chen, Lan and Xin, Jingyu and Jiang, Yuxin and Zhan, Guanqi and Lu, Liming and Chen, Junyu and Ge, Wenhang and Mao, Qi and Ye, Yixuan and Lu, Dongyue and Huang, Junchao and Shou, Mike Zheng and Han, Song and Cai, Han}, journal={arXiv preprint arXiv:2612.05524}, year={2026}}```
## Acknowledgements
We thank the authors of [Diffusers](https://github.com/huggingface/diffusers), [PEFT](https://github.com/huggingface/peft), [FLUX](https://huggingface.co/black-forest-labs), [Wan](https://github.com/Wan-Video/Wan2.1), and [MiniMax H3](https://huggingface.co/MiniMaxAI/MiniMax-H3) for their models and tools.123version https://git-lfs.github.com/spec/v1oid sha256:473b4b7fa6558021b5f10d52b070e5e8d50edadcda2b1bd932c1608f2e72c9d8size 2460773611123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263name: test_wan14b_480p_anyflow2_datafree_lr5e-5_1k_b16mode: evalmanual_seed: 0mixed_precision: true
# dataset and data loader settingsdatasets: sample: type: PromptDataset prompt_path: assets/validation/wan/eval_caption_t2v.json preprocess_cfg: height: 480 width: 832
models: transformer_cfg: model_name: experiments/pretrained_models/Wan2.1-T2V-14B-Diffusers model_type: WanAnyFlow2Transformer3DModel enable_gradient_checkpoint: true lora_config: lora_rank: 256 lora_alpha: 256 target_module_name: ["attn1", "attn2", "ffn", "proj_out"] param_names_to_optimize: ["lora_A", "lora_B"] continuous_basis_cfg: num_horizon_basis: 128 shift: 10.0 pretrained_path: experiments/pretrained_models/AnyFlow2-LoRA-Collections/Wan2.1-T2V-14B/AnyFlow2-Wan2.1-T2V-14B-4step.pt pretrained_weight: ema pretrained_type: lora text_encoder_cfg: drop_text_ratio: 0.0 negative_prompt: assets/negative_prompts/wan.json vae_cfg: load: true scheduler_cfg: shift: 10.0 final_step_size_scale: 0.3 distill_cfg: {}
# pathpath: pretrain_network: ~
# inference entry pointtrain: train_pipeline: WanAnyFlow2Trainer
# validation settingsval: val_pipeline: WanAnyFlow2Pipeline skip_first_eval: true sample_freq: 100 eval_freq: 999999 sample_cfg: height: 480 width: 832 seed: [0, 1] guidance_scale: 1.0 num_inference_steps: [4] num_frames: 81 fps: 16
.gitattributesAdded+35
FLUX.1-Dev/AnyFlow2-FLUX.1-Dev-4step.ptAdded+3
FLUX.1-Dev/inference.ymlAdded+56
FLUX.3-Klevin-Base/AnyFlow2-FLUX.3-Klevin-Base-4step.ptAdded+3
FLUX.3-Klevin-Base/inference.ymlAdded+57
H3-Ref2VA-33B/AnyFlow2-H3-Ref2VA-33B-4step.ptAdded+3
H3-Ref2VA-33B/inference.ymlAdded+71
H3-T2VA-33B/AnyFlow2-H3-T2VA-33B-4step.ptAdded+3
H3-T2VA-33B/inference.ymlAdded+72
LICENSEAdded+201
README.mdAdded+164
Wan2.1-T2V-14B/AnyFlow2-Wan2.1-T2V-14B-4step.ptAdded+3
Wan2.1-T2V-14B/inference.ymlAdded+63