{"slug": "fine-tune-video-and-image-models-at-scale-with-nvidia-nemo-automodel-and", "title": "Fine-tune video and image models at scale with NVIDIA NeMo Automodel and 🤗 Diffusers", "summary": "NVIDIA and Hugging Face announced a collaboration integrating NVIDIA NeMo Automodel with the Hugging Face Diffusers library, enabling distributed fine-tuning of diffusion models at scale without checkpoint conversion. The open-source integration supports models like FLUX.1-dev, Wan 2.1, and HunyuanVideo, allowing users to scale training from one to hundreds of GPUs using configurable parallelism strategies.", "body_md": "Text-to-Image • 20B • Updated • 185k • 2.54k\n\n# Fine-tune video and image models at scale with NVIDIA NeMo Automodel and 🤗 Diffusers\n\n[Enterprise + Article](/blog)\n\n*A joint post from NVIDIA and Hugging Face. Special thanks to Sayak Paul from Hugging Face for their contributions to the integration work and for co-authoring this blog.*\n\nDiffusion models power some of the most exciting open-source releases of the last two years — such as [FLUX.1-dev](https://huggingface.co/black-forest-labs/FLUX.1-dev) for text-to-image and [Wan 2.1](https://huggingface.co/Wan-AI/Wan2.1-T2V-1.3B-Diffusers) and [HunyuanVideo](https://huggingface.co/hunyuanvideo-community/HunyuanVideo-1.5-Diffusers-720p_t2v) for text-to-video. The 🤗 [Diffusers](https://github.com/huggingface/diffusers) library has become the de facto home for these models, giving researchers and builders a single, consistent interface for inference, adaptation, and pipeline composition.\n\nIn addition, training and fine-tuning diffusion models are also on the rise, requiring utilities that offer memory-efficient sharding, latent caching, multiresolution bucketing, and configurations that scale gracefully from one GPU to hundreds.\n\nTo cater to these technical demands, we offer the [NVIDIA NeMo Automodel](https://github.com/NVIDIA-NeMo/Automodel) open-source library. Today, we're highlighting the collaboration between NVIDIA and Hugging Face that brings production-grade, distributed diffusion training to any Diffusers-format model on the Hugging Face Hub — with no checkpoint conversion and no model rewrites for any new model. The integration is documented in the [Diffusers training guide](https://docs.nvidia.com/nemo/automodel/recipes-e2e-examples/diffusion-fine-tuning) and is fully open source under Apache 2.0.\n\n## Table of contents\n\n[What is NeMo Automodel?](#what-is-nemo-automodel)[Supported diffusion models](#supported-diffusion-models)[What this collaboration unlocks](#what-this-collaboration-unlocks)[A look at the fine-tuning workflow](#a-look-at-the-fine-tuning-workflow)[Other Finetuned/LoRA examples](#other-finetunedlora-examples)[Try it today](#try-it-today)[Coming next: Pythonic recipe APIs](#coming-next-pythonic-recipe-apis)[Resources](#resources)\n\n## What is NeMo Automodel?\n\nNeMo Automodel is an open-source PyTorch DTensor-native training library, part of the NVIDIA NeMo framework, built around two design principles that matter for the Diffusers ecosystem:\n\n**Hugging Face native.** Point`pretrained_model_name_or_path`\n\nat any Diffusers model ID on the Hub and start training. NeMo Automodel uses Diffusers model classes (e.g.`WanTransformer3DModel`\n\n) for loading and Diffusers pipelines (`WanPipeline`\n\n) for generation. Checkpoints round-trip cleanly back into the Diffusers ecosystem.**One program, any scale.** The recipes and training scripts can be easily modified to suit training at any scale. Parallelism is a configuration choice, not a code rewrite — switch between FSDP2, tensor parallel, expert parallel, context parallel, and pipeline parallel by declaring configurations, not rewriting models.\n\nAutoModel currently supports flow-matching models only. Under the hood, it uses flow matching as the training objective, with latent-space training (via pre-encoded VAE outputs) and multiresolution bucketed dataloading to accelerate throughput.\n\n## Supported diffusion models\n\nNeMo Automodel integration ships with ready-to-use fine-tuning recipes for the open diffusion models below. The list reflects the recipes currently in `examples/diffusion/finetune`\n\n.\n\n| Model | Hugging Face ID | Task | Parameters | LoRA recipe |\n|---|---|---|---|---|\n| Wan 2.1 T2V 1.3B / 14B |\n`Wan-AI/Wan2.1-T2V-1.3B-Diffusers` |\n\n`Wan-AI/Wan2.1-T2V-14B-Diffusers`\n\n`Wan-AI/Wan2.2-T2V-A14B-Diffusers`\n\n`black-forest-labs/FLUX.1-dev`\n\n`black-forest-labs/FLUX.2-dev`\n\n`hunyuanvideo-community/HunyuanVideo-1.5-Diffusers-720p_t2v`\n\n`Qwen/Qwen-Image`\n\n## What this collaboration unlocks\n\nFor Diffusers users, the practical gains break down into a few concrete capabilities.\n\n**No checkpoint conversion.** Pretrained weights from the Hub work out of the box. There's no separate \"training format\" to convert to, then convert back. Your fine-tuned checkpoint loads directly into a `DiffusionPipeline`\n\nfor inference, or back to the Hub for sharing. Downstream tools — quantization, compilation, LoRA adapters, custom samplers — all keep working.\n\n**Fast path to new model support.** When a new diffusion model lands in Diffusers, enabling it in NeMo Automodel takes a small, contained code addition — a data preprocessing handler and a model adapter — rather than a full custom training script. The rest of the recipe stack (FSDP2, bucketed dataloading, checkpointing, generation) carries over unchanged, and the same YAML-driven workflow applies.\n\n**Full and parameter-efficient fine-tuning.** Both full fine-tuning and LoRA-style PEFT are supported, so you can choose between maximum quality (full FT on a large cluster) or maximum efficiency (LoRA on a single node). The same recipe structure handles both.\n\n**Scalable training that goes beyond what built-in scripts offer.** NeMo Automodel adds sharding schemes such as FSDP2, tensor, context, and pipeline parallelisms, multi-node orchestration (SLURM today, Kubernetes coming), and multiresolution bucketing. These capabilities make training larger models like FLUX.1-dev (12B) and HunyuanVideo (13B) possible.\n\n## A look at the fine-tuning workflow\n\nIn this section, we walk through the typical workflow for fine-tuning any of the supported models. The recommended way to install Automodel is the NeMo Automodel Docker container (`nvcr.io/nvidia/nemo-automodel:26.06`\n\n), which ships with PyTorch, TransformerEngine, and other CUDA-compiled dependencies pre-built. Alternatively, install with `pip3 install nemo-automodel`\n\nor from source (`pip3 install git+https://github.com/NVIDIA-NeMo/Automodel.git`\n\n); see the [installation guide](https://docs.nvidia.com/nemo/automodel/latest/get-started/installation) for all options.\n\nThis guide walks through a full-transformer fine-tune of FLUX.1-dev on the 78-card [Rider–Waite tarot dataset](https://huggingface.co/datasets/multimodalart/1920-raider-waite-tarot-public-domain), then generating from the resulting checkpoint. It reuses the checked-in YAML configs and applies run-specific settings as command-line overrides, so no new config files are required.\n\n### 1. Pre-encode the dataset\n\nThe diffusion recipe consumes cached VAE latents and text embeddings instead of encoding source images during every training step. Stream the 78 Rider–Waite images directly from Hugging Face and distribute preprocessing across all visible GPUs:\n\n```\nuv run --locked --no-default-groups \\\n  --extra diffusion \\\n  --extra diffusion-media \\\npython -m tools.diffusion.preprocessing_multiprocess image \\\n  --dataset_name multimodalart/1920-raider-waite-tarot-public-domain \\\n  --dataset_media_column image \\\n  --dataset_caption_column caption \\\n  --dataset_streaming \\\n  --max_images 78 \\\n  --output_dir /cache/flux_tarot \\\n  --processor flux \\\n  --model_name black-forest-labs/FLUX.1-dev \\\n  --max_pixels 245760\n```\n\nThe captions already contain the `trtcrd`\n\ntrigger token. With this pixel budget and the dataset's portrait aspect ratio, preprocessing assigns the samples to the 384×640 bucket used by the showcase run.\n\nFor image training, preprocessing produces `.pt`\n\ncache files and sharded metadata:\n\n```\n/cache/flux_tarot/\n├── 384x640/\n│   ├── <hash1>.pt\n│   └── ...\n├── metadata_shard_0000.json\n├── metadata.json\n└── _hf_dataset/\n    └── images/\n```\n\n### 2. Launch training with the existing FLUX YAML\n\nUse `examples/diffusion/finetune/flux_t2i_flow.yaml`\n\ndirectly. The YAML already selects FLUX.1-dev, full transformer fine-tuning, the FLUX flow-matching adapter, an effective batch size of 32, and eight-way FSDP2.\n\nSupply the tarot-specific paths and settings as command-line overrides:\n\n```\nuv run --locked --no-default-groups --extra diffusion \\\n  torchrun --nproc-per-node=8 \\\n  examples/diffusion/finetune/finetune.py \\\n  -c examples/diffusion/finetune/flux_t2i_flow.yaml \\\n  --model.transformer_engine_fp8 false \\\n  --data.dataloader.cache_dir /cache/flux_tarot \\\n  --data.dataloader.base_resolution '[384,640]' \\\n  --lr_scheduler.lr_decay_style constant \\\n  --lr_scheduler.lr_warmup_steps 20 \\\n  --step_scheduler.max_steps 200 \\\n  --step_scheduler.ckpt_every_steps 50 \\\n  --checkpoint.checkpoint_dir /tmp/flux_tarot/checkpoints/full \\\n  --checkpoint.save_consolidated true \\\n  --seed 2026\n```\n\nThe run produces checkpoints at steps 50, 100, 150, and 200. The final checkpoint is labeled `epoch_66_step_199`\n\n; the label is zero-based even though it represents the completed 200th optimizer step.\n\n### 3. Generate from the fine-tuned checkpoint\n\nUse the existing FLUX generation YAML and point `model.checkpoint`\n\nat the complete training checkpoint:\n\n```\nuv run --locked --no-default-groups --extra diffusion \\\n  python examples/diffusion/generate/generate.py \\\n  -c examples/diffusion/generate/configs/generate_flux.yaml \\\n  --model.checkpoint /tmp/flux_tarot/checkpoints/full/epoch_66_step_199 \\\n  --inference.height 640 \\\n  --inference.width 384 \\\n  --inference.prompts '[\"a trtcrd of an astronaut tending a rose garden on Mars, \\\"the gardener\\\"\"]' \\\n  --output.output_dir /tmp/flux_tarot/generations/full/step_200 \\\n  --seed 2026\n```\n\nInclude `trtcrd`\n\nto invoke the learned tarot style. For a control comparison, keep the seed and scene fixed but omit the trigger:\n\n```\nuv run --locked --no-default-groups --extra diffusion \\\n  python examples/diffusion/generate/generate.py \\\n  -c examples/diffusion/generate/configs/generate_flux.yaml \\\n  --model.checkpoint /tmp/flux_tarot/checkpoints/full/epoch_66_step_199 \\\n  --inference.height 640 \\\n  --inference.width 384 \\\n  --inference.prompts '[\"an astronaut tending a rose garden on Mars, \\\"the gardener\\\"\"]' \\\n  --output.output_dir /tmp/flux_tarot/generations/control \\\n  --seed 2026\n```\n\n#### Results\n\nAt step 200, the triggered astronaut prompts retain their requested content while acquiring a cream, red, and black vintage palette, heavy ink contours, flat color fields, aged-paper tones, and allegorical card composition. The untriggered astronaut remains photographic, demonstrating that the learned effect is substantially associated with `trtcrd`\n\nrather than replacing the base model globally.\n\n| Prompt (seed) | Baseline | Fine-tuned (step 200) |\n|---|---|---|\n| Astronaut tending a rose garden on Mars (seed 2026) | ||\n| Astronaut in a moonlit garden on Mars (seed 2028) | ||\n| Astronaut planting a sapling beneath two moons (seed 2029) |\n\n### 4. Performance\n\nAll measurements were collected on one node with 8× NVIDIA H100 80GB GPUs. Results are means ± sample standard deviation over three steady-state 10-step windows.\n\n#### Text-to-image — 512×512(see if seconds can be aligned)\n\n| Model | Training | Parallelism | GBS / LBS | Step time | Images/s | Images/s/GPU | Peak allocated/GPU |\n|---|---|---|---|---|---|---|---|\n| FLUX.1-dev | Full | FSDP2 | 32 / 4 | 0.902 ± 0.039 s | 35.51 ± 1.55 | 4.44 ± 0.19 | 63.88 GiB |\n| FLUX.1-dev | LoRA r64 | DDP | 48 / 6 | 0.894 ± 0.008 s | 53.73 ± 0.48 | 6.72 ± 0.06 | 67.43 GiB |\n| Qwen-Image | Full | FSDP2 | 40 / 5 | 0.974 ± 0.075 s | 41.21 ± 3.06 | 5.15 ± 0.38 | 53.55 GiB |\n| Qwen-Image | LoRA r64 | DDP | 24 / 3 | 0.515 ± 0.006 s | 46.63 ± 0.54 | 5.83 ± 0.07 | 66.33 GiB |\n\n#### Text-to-video — 512×512×49 frames\n\nEach sample is one 49-frame video clip.\n\n| Model | Training | GBS / LBS | Activation checkpointing | Step time | Clips/s | Clips/s/GPU | Peak allocated/GPU |\n|---|---|---|---|---|---|---|---|\n| Wan 2.1 1.3B | Full | 8 / 1 | Off | 0.942 ± 0.038 s | 8.50 ± 0.35 | 1.06 ± 0.04 | 6.09 GiB |\n| Wan 2.1 14B | Full | 8 / 1 | On | 3.798 ± 0.017 s | 2.107 ± 0.006 | 0.263 ± 0.006 | 33.35 GiB |\n| Wan 2.1 14B | LoRA r64 | 16 / 2 | On | 7.585 ± 0.014 s | 2.110 ± 0.000 | 0.263 ± 0.000 | 24.07 GiB |\n| Wan 2.2 A14B, high-noise | Full | 8 / 1 | On | 4.628 ± 0.031 s | 1.730 ± 0.010 | 0.217 ± 0.006 | 23.57 GiB |\n| HunyuanVideo 1.5 | Full | 8 / 1 | On | 5.926 ± 0.046 s | 1.350 ± 0.010 | 0.170 ± 0.000 | 15.90 GiB |\n| HunyuanVideo 1.5 | LoRA r64 | 8 / 1 | On | 5.575 ± 0.006 s | 1.433 ± 0.006 | 0.180 ± 0.000 | 10.58 GiB |\n\n**Measurement details**\n\n- Hardware: 8× H100 80GB HBM3, fully NVLink-connected.\n- Image dataset:\n, 256 cached samples.`lambda/naruto-blip-captions`\n\n- Video dataset:\n, 112 cached samples.`svjack/Lelouch_Vi_Britannia_FramePack_First_Last_Frame_Video_Captioned`\n\n- Full batches were enforced with\n`drop_last=true`\n\n. - Checkpoint writes were disabled.\n- Step time includes dataloading, forward, backward, gradient clipping, optimizer, and scheduler work.\n- Memory is peak PyTorch CUDA allocator usage, not total NVML device memory.\n\n## Other Finetuned/LoRA examples\n\nThe results from fine-tuning and LoRA showcase the power of NeMo Automodel for domain specialization. For instance, fine-tuning the Wan 2.1 model on a Ghibli video dataset successfully adapted the output style, demonstrated by a noticeable change in a flower's appearance compared to the baseline.\n\n*Baseline:*\n\n*Finetuned on Ghibli's videos:*\n\nWe also observed the distinct impact of using LoRA, where applying the adapter to Wan 2.1 caused the video to adopt a characteristic Ghibli style, particularly visible in the highlighting of characters' eyes.\n\n*No LoRA:*\n\n*LoRA:*\n\nThese examples, including those for FLUX.2, confirm that users can achieve both maximum quality via full fine-tuning and maximum efficiency via LoRA-style PEFT, tailoring the output to specific stylistic domains.\n\n## Try it today\n\nLearn more about the integration and find more fine-tuning examples in the [NeMo Automodel documentation](https://docs.nvidia.com/nemo/automodel/recipes-e2e-examples/diffusion-fine-tuning)\n\n## Coming next: Pythonic recipe APIs\n\nYAML is a strong fit for reproducible configuration, especially for teams that want files they can check in, review, and reuse, but many teams also need a programmatic interface.\n\nIn an upcoming NeMo Automodel release, we plan to surface the diffusion recipes through a fully typed Pythonic API as well. Users will be able to compose the same model, data, optimizer, PEFT/LoRA, parallelism, checkpointing, and generation pieces directly from Python.\n\nThe Pythonic path is intended to make the recipes easier to use from existing training code, notebooks, and experiment workflows, and to offer a first-class Pythonic interface alongside the YAML quick-start path.", "url": "https://wpnews.pro/news/fine-tune-video-and-image-models-at-scale-with-nvidia-nemo-automodel-and", "canonical_source": "https://huggingface.co/blog/nvidia/scale-diffusers-finetuning-nemo-automodel", "published_at": "2026-07-17 15:57:54+00:00", "updated_at": "2026-07-17 16:06:06.336238+00:00", "lang": "en", "topics": ["artificial-intelligence", "machine-learning", "generative-ai", "ai-tools", "ai-infrastructure"], "entities": ["NVIDIA", "Hugging Face", "NeMo Automodel", "Diffusers", "FLUX.1-dev", "Wan 2.1", "HunyuanVideo", "PyTorch"], "alternates": {"html": "https://wpnews.pro/news/fine-tune-video-and-image-models-at-scale-with-nvidia-nemo-automodel-and", "markdown": "https://wpnews.pro/news/fine-tune-video-and-image-models-at-scale-with-nvidia-nemo-automodel-and.md", "text": "https://wpnews.pro/news/fine-tune-video-and-image-models-at-scale-with-nvidia-nemo-automodel-and.txt", "jsonld": "https://wpnews.pro/news/fine-tune-video-and-image-models-at-scale-with-nvidia-nemo-automodel-and.jsonld"}}