From 35f10236f27b47d7caf6b2b4f9ba2af0ec35277c Mon Sep 17 00:00:00 2001 From: bubbliiiing <3323290568@qq.com> Date: Thu, 24 Sep 2026 15:32:51 +0800 Subject: [PATCH] Update Readme, add print in predict code, fix bug in fsdp text encoder --- README.md | 130 +++++++++--------- README_ja-JP.md | 130 +++++++++--------- README_zh-CN.md | 36 ++--- examples/cogvideox_fun/predict_i2v.py | 1 + examples/cogvideox_fun/predict_t2v.py | 1 + examples/cogvideox_fun/predict_v2v.py | 1 + examples/cogvideox_fun/predict_v2v_control.py | 1 + examples/ernie_image/predict_t2i.py | 1 + examples/fantasytalking/predict_s2v.py | 1 + examples/flashhead/predict_s2v.py | 1 + examples/flux/predict_t2i.py | 3 +- examples/flux2/predict_t2i.py | 3 +- examples/flux2_fun/predict_i2i_inpaint.py | 3 +- examples/flux2_fun/predict_t2i_control.py | 3 +- examples/flux2_fun/predict_t2i_control_ref.py | 3 +- examples/hunyuanvideo/predict_i2v.py | 1 + examples/hunyuanvideo/predict_t2v.py | 1 + examples/infinitetalk/predict_s2v.py | 1 + examples/lens/predict_t2i.py | 1 + examples/lingbot_video/predict_i2v.py | 1 + examples/lingbot_video/predict_t2v.py | 1 + examples/lingbot_world/predict_i2v.py | 1 + examples/longcatvideo/predict_i2v.py | 1 + examples/longcatvideo/predict_s2v_avatar.py | 1 + examples/longcatvideo/predict_t2v.py | 1 + examples/ltx2.3/predict_i2v.py | 3 +- examples/ltx2.3/predict_t2v.py | 3 +- examples/ltx2/predict_i2v.py | 3 +- examples/ltx2/predict_i2v_upsample.py | 3 +- examples/ltx2/predict_t2v.py | 3 +- examples/mova/predict_i2v.py | 1 + examples/phantom/predict_s2v.py | 1 + examples/qwenimage/predict_i2i_layered.py | 3 +- examples/qwenimage/predict_t2i.py | 3 +- examples/qwenimage/predict_t2i_edit.py | 3 +- examples/qwenimage/predict_t2i_edit_plus.py | 3 +- examples/qwenimage21/predict_t2i.py | 3 +- .../qwenimage21_fun/predict_i2i_inpaint.py | 1 + .../qwenimage21_fun/predict_t2i_control.py | 1 + examples/qwenimage_fun/predict_i2i_inpaint.py | 3 +- examples/qwenimage_fun/predict_t2i_control.py | 3 +- .../qwenimage_instantx/predict_t2i_control.py | 3 +- examples/turbodiffusion/predict_i2v_wan2.2.py | 1 + examples/turbodiffusion/predict_t2v_wan2.1.py | 1 + examples/wan2.1/predict_i2v.py | 1 + examples/wan2.1/predict_i2v_tae.py | 1 + examples/wan2.1/predict_t2v.py | 1 + examples/wan2.1/predict_t2v_tae.py | 1 + examples/wan2.1_causal_forcing/predict_t2v.py | 1 + .../predict_t2v_stream.py | 1 + examples/wan2.1_flex_forcing/predict_t2v.py | 1 + .../wan2.1_flex_forcing/predict_t2v_edit.py | 1 + examples/wan2.1_fun/predict_i2v.py | 1 + examples/wan2.1_fun/predict_t2v.py | 1 + examples/wan2.1_fun/predict_v2v_control.py | 1 + .../wan2.1_fun/predict_v2v_control_camera.py | 1 + .../wan2.1_fun/predict_v2v_control_ref.py | 1 + examples/wan2.1_self_forcing/predict_t2v.py | 1 + .../predict_t2v_forcing_kv.py | 1 + .../wan2.1_self_forcing/predict_t2v_stream.py | 1 + examples/wan2.1_vace/predict_i2v.py | 1 + examples/wan2.1_vace/predict_s2v.py | 1 + examples/wan2.1_vace/predict_v2v_control.py | 1 + examples/wan2.2/predict_animate.py | 1 + examples/wan2.2/predict_i2v.py | 1 + examples/wan2.2/predict_s2v.py | 1 + examples/wan2.2/predict_t2v.py | 1 + examples/wan2.2/predict_ti2v.py | 1 + examples/wan2.2/predict_ti2v_tae.py | 1 + examples/wan2.2_fun/predict_i2v.py | 1 + examples/wan2.2_fun/predict_i2v_2.2vae.py | 1 + examples/wan2.2_fun/predict_i2v_2.2vae_tae.py | 1 + examples/wan2.2_fun/predict_i2v_5b.py | 1 + examples/wan2.2_fun/predict_t2v.py | 1 + examples/wan2.2_fun/predict_t2v_2.2vae.py | 1 + examples/wan2.2_fun/predict_t2v_2.2vae_tae.py | 1 + examples/wan2.2_fun/predict_t2v_5b.py | 1 + examples/wan2.2_fun/predict_v2v_control.py | 1 + examples/wan2.2_fun/predict_v2v_control_5b.py | 1 + .../wan2.2_fun/predict_v2v_control_camera.py | 1 + .../predict_v2v_control_camera_5b.py | 1 + .../wan2.2_fun/predict_v2v_control_ref.py | 1 + .../wan2.2_fun/predict_v2v_control_ref_5b.py | 1 + examples/wan2.2_vace_fun/predict_i2v.py | 1 + examples/wan2.2_vace_fun/predict_s2v.py | 1 + .../wan2.2_vace_fun/predict_v2v_control.py | 1 + .../predict_v2v_control_ref.py | 1 + examples/wan2.2_vace_fun/predict_v2v_mask.py | 1 + examples/z_image/predict_t2i.py | 3 +- examples/z_image/predict_turbo_t2i.py | 3 +- .../z_image_fun/predict_i2i_inpaint_2.1.py | 3 +- .../predict_i2i_inpaint_2.1_lite.py | 3 +- examples/z_image_fun/predict_i2i_tile_2.1.py | 3 +- .../z_image_fun/predict_i2i_tile_2.1_lite.py | 3 +- .../z_image_fun/predict_t2i_control_2.1.py | 3 +- .../predict_t2i_control_2.1_lite.py | 3 +- .../predict_turbo_i2i_inpaint_2.0.py | 3 +- .../predict_turbo_i2i_inpaint_2.1.py | 3 +- .../predict_turbo_i2i_inpaint_2.1_lite.py | 3 +- .../z_image_fun/predict_turbo_i2i_tile_2.1.py | 3 +- .../predict_turbo_i2i_tile_2.1_lite.py | 3 +- .../z_image_fun/predict_turbo_t2i_control.py | 3 +- .../predict_turbo_t2i_control_2.0.py | 3 +- .../predict_turbo_t2i_control_2.1.py | 3 +- .../predict_turbo_t2i_control_2.1_lite.py | 3 +- scripts/qwenimage21_fun/README_TRAIN.md | 37 +++-- scripts/qwenimage21_fun/README_TRAIN_zh-CN.md | 36 +++-- 107 files changed, 334 insertions(+), 207 deletions(-) diff --git a/README.md b/README.md index 623bfa0..1c87c97 100755 --- a/README.md +++ b/README.md @@ -26,24 +26,6 @@ English | [简体中文](./README_zh-CN.md) | [日本語](./README_ja-JP.md) # I. Introduction VideoX-Fun is a video generation pipeline that can be used to generate AI images and videos, as well as to train baseline and Lora models for Diffusion Transformer. We support direct prediction from pre-trained baseline models to generate videos with different resolutions, durations, and FPS. Additionally, we also support users in training their own baseline and Lora models to perform specific style transformations. -What's New: -- Added support for Wan 2.2 series models, Wan-VACE control model, Fantasy Talking digital human model, Qwen-Image, Flux image generation models, and more. [2025.10.16] -- Update Wan2.1-Fun-V1.1: Support for 14B and 1.3B model Control + Reference Image models, support for camera control, and the Inpaint model has been retrained for improved performance. [2025.04.25] -- Update Wan2.1-Fun-V1.0: Support I2V and Control models for 14B and 1.3B models, with support for start and end frame prediction. [2025.03.26] -- Update CogVideoX-Fun-V1.5: Upload I2V model and related training/prediction code. [2024.12.16] -- Reward Lora Support: Train Lora using reward backpropagation techniques to optimize generated videos, making them better aligned with human preferences. [More Information](scripts/README_TRAIN_REWARD.md). New version of the control model supports various control conditions such as Canny, Depth, Pose, MLSD, etc. [2024.11.21] -- Diffusers Support: CogVideoX-Fun Control is now supported in diffusers. Thanks to [a-r-r-o-w](https://github.com/a-r-r-o-w) for contributing support in this [PR](https://github.com/huggingface/diffusers/pull/9671). Check out the [documentation](https://huggingface.co/docs/diffusers/main/en/api/pipelines/cogvideox) for more details. [2024.10.16] -- Update CogVideoX-Fun-V1.1: Retrain i2v model, add Noise to increase the motion amplitude of the video. Upload control model training code and Control model. [2024.09.29] -- Update CogVideoX-Fun-V1.0: Initial code release! Now supports Windows and Linux. Supports video generation at arbitrary resolutions from 256x256x49 to 1024x1024x49 for 2B and 5B models. [2024.09.18] - -Function: -- [Data Preprocessing](#data-preprocess) -- [Train DiT](#dit-train) -- [Video Generation](#video-gen) - -Our UI interface is as follows: -![ui](https://pai-aigc-photog.oss-cn-hangzhou.aliyuncs.com/cogvideox_fun/asset/v1/ui.jpg) - # II. Quick Start and Usage @@ -355,7 +337,7 @@ The table below summarizes currently supported model families and weights. Video | Phantom | Video | Incremental weights for multi-subject reference video generation; based on Wan2.1-T2V |
Phantom-Wan-1.3B🤗-1.3B version. Officially released as .pth; place in Personalized_Model and reference via transformer_path in predict file
Phantom-Wan-14B🤗-14B version. Officially released as sharded safetensors
| | Qwen-Image | Image | Official text-to-image and image-editing weights; supports baseline and LoRA training |
Qwen-Image🤗🤖文生图基础权重
Qwen-Image-2512🤗🤖Updated text-to-image version
Qwen-Image-Edit🤗🤖图像编辑
Qwen-Image-Edit-2509🤗🤖图像编辑更新版本
Qwen-Image-Layered🤗🤖Image layer-decomposition weights; splits an image into multiple editable RGBA layers
| | Qwen-Image-2.1 | Image | Official next-generation text-to-image weights; single-stream block-causal transformer with prefix KV cache |
Qwen-Image-2.1🤗🤖Single-stream block-causal transformer; supports full-parameter training, prefix KV cache speeds up inference
| -| Qwen-Image ControlNet | Image | Image controlled generation; supports Canny, Depth, Pose, MLSD, and Scribble |
Qwen-Image-2512-Fun-Controlnet-Union🤗🤖ControlNet weights for Qwen-Image-2512, supporting multiple control conditions such as Canny, Depth, Pose, MLSD, Scribble, etc.
Qwen-Image-ControlNet-Union🤗🤖Equivalent ControlNet provided by InstantX
| +| Qwen-Image ControlNet | Image | Image controlled generation; supports Canny, Depth, Pose, MLSD, and Scribble |
Qwen-Image-2512-Fun-Controlnet-Union🤗🤖ControlNet weights for Qwen-Image-2512, supporting multiple control conditions such as Canny, Depth, Pose, MLSD, Scribble, etc.
Qwen-Image-2.1-Fun-Controlnet-Union🤗🤖ControlNet-Union weights for Qwen-Image-2.1 trained by this project, supporting control conditions such as Canny, Depth, Pose, MLSD, and image inpainting
Qwen-Image-ControlNet-Union🤗🤖Equivalent ControlNet provided by InstantX
| | Z-Image | Image | Official text-to-image weights |
Z-Image🤗🤖基础版
Z-Image-Turbo🤗🤖加速版
| | Z-Image-Fun | Image | ControlNet and distillation LoRA trained by this project on Z-Image; supports Canny, Depth, Pose, MLSD, Scribble, and Gray |
Z-Image-Fun-Controlnet-Union-2.1🤗🤖ControlNet weights for Z-Image. Compared to the first version, it adds to more layers and has been trained for a longer period. It supports multiple control conditions including Canny, Depth, Pose, MLSD, Scribble and Gray.
Z-Image-Turbo-Fun-Controlnet-Union🤗🤖ControlNet weights for Z-Image-Turbo, supporting multiple control conditions such as Canny, Depth, Pose, MLSD, etc.
Z-Image-Turbo-Fun-Controlnet-Union-2.1🤗🤖ControlNet weights for Z-Image-Turbo. Compared to the first version, it adds to more layers and has been trained for a longer period. It supports multiple control conditions including Canny, Depth, Pose, MLSD, and more.
Z-Image-Fun-Lora-Distill🤗🤖This is a Distill LoRA for Z-Image that distills both steps and CFG. This model does not require CFG and uses 8 steps for inference.
| | Flux | Image | Official FLUX.1/FLUX.2 weights and the ControlNet trained by this project |
FLUX.1-dev🤗🤖文生图与图像编辑
FLUX.2-dev🤗🤖第二代官方权重
FLUX.2-dev-Fun-Controlnet-Union🤗🤖ControlNet weights for FLUX.2-dev
| @@ -375,16 +357,16 @@ The table below summarizes currently supported model families and weights. Video
- + - + - + - +
@@ -392,21 +374,22 @@ The table below summarizes currently supported model families and weights. Video
- + - + - + - +
-### Wan2.1-Fun-V1.1-14B-Control && Wan2.1-Fun-V1.1-1.3B-Control +
+Wan2.1-Fun-V1.1-14B-Control && Wan2.1-Fun-V1.1-1.3B-Control Generic Control Video + Reference Image: @@ -427,16 +410,16 @@ Generic Control Video + Reference Image: - + - + - + - + @@ -447,13 +430,13 @@ Generic Control Video (Canny, Pose, Depth, etc.) and Trajectory Control:
- + - + - +
@@ -461,29 +444,32 @@ Generic Control Video (Canny, Pose, Depth, etc.) and Trajectory Control:
- + - + - +
- + - + - +
-### Wan2.1-Fun-V1.1-14B-Control-Camera && Wan2.1-Fun-V1.1-1.3B-Control-Camera +
+ +
+Wan2.1-Fun-V1.1-14B-Control-Camera && Wan2.1-Fun-V1.1-1.3B-Control-Camera @@ -499,13 +485,13 @@ Generic Control Video (Canny, Pose, Depth, etc.) and Trajectory Control: @@ -521,34 +507,37 @@ Generic Control Video (Canny, Pose, Depth, etc.) and Trajectory Control:
- + - + - +
- + - + - +
-### CogVideoX-Fun-V1.1-5B +
+ +
+CogVideoX-Fun-V1.1-5B Resolution-1024
- + - + - + - +
@@ -559,16 +548,16 @@ Resolution-768
- + - + - + - +
@@ -578,32 +567,35 @@ Resolution-512
- + - + - + - +
-### CogVideoX-Fun-V1.1-5B-Control +
+ +
+CogVideoX-Fun-V1.1-5B-Control @@ -619,17 +611,19 @@ Resolution-512
- + - + - +
- + - + - +
+
+ # V. References - CogVideo: https://github.com/THUDM/CogVideo/ - EasyAnimate: https://github.com/aigc-apps/EasyAnimate diff --git a/README_ja-JP.md b/README_ja-JP.md index 4d88eab..fc9ed4f 100755 --- a/README_ja-JP.md +++ b/README_ja-JP.md @@ -26,24 +26,6 @@ Wan-Fun: # 一、紹介 VideoX-Funはビデオ生成のパイプラインであり、AI画像やビデオの生成、Diffusion TransformerのベースラインモデルとLoraモデルのトレーニングに使用できます。我々は、すでに学習済みのベースラインモデルから直接予測を行い、異なる解像度、秒数、FPSのビデオを生成することをサポートしています。また、ユーザーが独自のベースラインモデルやLoraモデルをトレーニングし、特定のスタイル変換を行うこともサポートしています。 -新機能: -- Wan 2.2シリーズモデル、Wan-VACE制御モデル、Fantasy Talkingデジタルヒューマンモデル、Qwen-Image、Flux画像生成モデルなどのサポートを追加しました。[2025.10.16] -- Wan2.1-Fun-V1.1バージョンを更新:14Bと1.3BモデルのControl+参照画像モデルをサポート、カメラ制御にも対応。さらに、Inpaintモデルを再訓練し、性能が向上しました。[2025.04.25] -- Wan2.1-Fun-V1.0の更新:14Bおよび1.3BのI2V(画像からビデオ)モデルとControlモデルをサポートし、開始フレームと終了フレームの予測に対応。[2025.03.26] -- CogVideoX-Fun-V1.5の更新:I2Vモデルと関連するトレーニング・予測コードをアップロード。[2024.12.16] -- 報酬Loraのサポート:報酬逆伝播技術を使用してLoraをトレーニングし、生成された動画を最適化し、人間の好みによりよく一致させる。[詳細情報](scripts/README_TRAIN_REWARD.md)。新しいバージョンの制御モデルでは、Canny、Depth、Pose、MLSDなどの異なる制御条件に対応。[2024.11.21] -- diffusersのサポート:CogVideoX-Fun Controlがdiffusersでサポートされるようになりました。[a-r-r-o-w](https://github.com/a-r-r-o-w)がこの[PR](https://github.com/huggingface/diffusers/pull/9671)でサポートを提供してくれたことに感謝します。詳細は[ドキュメント](https://huggingface.co/docs/diffusers/main/en/api/pipelines/cogvideox)をご覧ください。[2024.10.16] -- CogVideoX-Fun-V1.1の更新:i2vモデルを再トレーニングし、Noiseを追加して動画の動きの範囲を拡大。制御モデルのトレーニングコードとControlモデルをアップロード。[2024.09.29] -- CogVideoX-Fun-V1.0の更新:コードを作成!WindowsとLinuxに対応しました。2Bおよび5Bモデルでの最大256x256x49から1024x1024x49までの任意の解像度の動画生成をサポート。[2024.09.18] - -機能: -- [データ前処理](#data-preprocess) -- [DiTのトレーニング](#dit-train) -- [ビデオ生成](#video-gen) - -私たちのUIインターフェースは次のとおりです: -![ui](https://pai-aigc-photog.oss-cn-hangzhou.aliyuncs.com/cogvideox_fun/asset/v1/ui.jpg) - # 二、クイックスタートと使用 @@ -355,7 +337,7 @@ sh scripts/{model_name}/train.sh | Phantom | ビデオ | 複数主体参照による動画生成の増分重み。Wan2.1-T2Vベース |
Phantom-Wan-1.3B🤗-1.3B版。公式は.pth形式で公開。Personalized_Modelに配置しpredictファイルのtransformer_pathで指定
Phantom-Wan-14B🤗-14B版。公式は分割safetensors形式で公開
| | Qwen-Image | 画像 | 公式テキストから画像生成・画像編集重み。基線とLoRA訓練をサポート |
Qwen-Image🤗🤖文生图基础权重
Qwen-Image-2512🤗🤖テキストから画像生成の更新版
Qwen-Image-Edit🤗🤖图像编辑
Qwen-Image-Edit-2509🤗🤖图像编辑更新版本
Qwen-Image-Layered🤗🤖画像レイヤー分解重み。画像を複数の編集可能なRGBAレイヤーに分解可能
| | Qwen-Image-2.1 | 画像 | 公式次世代テキストから画像生成重み。シングルストリームblock-causal構造、プレフィックスKV cacheに対応 |
Qwen-Image-2.1🤗🤖シングルストリームblock-causal構造。全パラメータ訓練をサポート、プレフィックスKV cacheで推論を高速化
| -| Qwen-Image ControlNet | 画像 | 画像制御生成。Canny、Depth、Pose、MLSD、Scribbleをサポート |
Qwen-Image-2512-Fun-Controlnet-Union🤗🤖Qwen-Image-2512のControlNet重み。Canny、Depth、Pose、MLSD、Scribbleなど、複数の制御条件をサポートします。
Qwen-Image-ControlNet-Union🤗🤖InstantX提供の同種ControlNet
| +| Qwen-Image ControlNet | 画像 | 画像制御生成。Canny、Depth、Pose、MLSD、Scribbleをサポート |
Qwen-Image-2512-Fun-Controlnet-Union🤗🤖Qwen-Image-2512のControlNet重み。Canny、Depth、Pose、MLSD、Scribbleなど、複数の制御条件をサポートします。
Qwen-Image-2.1-Fun-Controlnet-Union🤗🤖本プロジェクトがQwen-Image 2.1向けに訓練したControlNet-Union。Canny、Depth、Pose、MLSDなどの制御条件と画像補完(inpaint)をサポートします。
Qwen-Image-ControlNet-Union🤗🤖InstantX提供の同種ControlNet
| | Z-Image | 画像 | 公式テキストから画像生成重み |
Z-Image🤗🤖基础版
Z-Image-Turbo🤗🤖加速版
| | Z-Image-Fun | 画像 | 本プロジェクトがZ-Imageで訓練したControlNetと蒸留LoRA。Canny、Depth、Pose、MLSD、Scribble、Grayをサポート |
Z-Image-Fun-Controlnet-Union-2.1🤗🤖Z-ImageのControlNet重み、Canny、Depth、Pose、MLSD、ScribbleおよびGrayなど複数の制御条件に対応。
Z-Image-Turbo-Fun-Controlnet-Union🤗🤖Z-Image-Turbo用のControlNet重み。Canny、Depth、Pose、MLSDなど複数の制御条件をサポート。
Z-Image-Turbo-Fun-Controlnet-Union-2.1🤗🤖Z-Image-TurboのControlNet重み。第1版と比較して、より多くの層に追加され、より長時間トレーニングされています。Canny、Depth、Pose、MLSDなど、複数の制御条件をサポートしています。
Z-Image-Fun-Lora-Distill🤗🤖これはZ-Image用の蒸留LoRAで、ステップ数とCFGの両方を蒸留します。このモデルはCFGを必要とせず、推論には8ステップを使用します。
| | Flux | 画像 | 公式FLUX.1/FLUX.2重みと本プロジェクトが訓練したControlNet |
FLUX.1-dev🤗🤖文生图与图像编辑
FLUX.2-dev🤗🤖第二代官方权重
FLUX.2-dev-Fun-Controlnet-Union🤗🤖FLUX.2-dev用ControlNet重み
| @@ -375,16 +357,16 @@ sh scripts/{model_name}/train.sh
- + - + - + - +
@@ -392,21 +374,22 @@ sh scripts/{model_name}/train.sh
- + - + - + - +
-### Wan2.1-Fun-V1.1-14B-Control && Wan2.1-Fun-V1.1-1.3B-Control +
+Wan2.1-Fun-V1.1-14B-Control && Wan2.1-Fun-V1.1-1.3B-Control 汎用制御動画 + 参照画像: @@ -427,16 +410,16 @@ sh scripts/{model_name}/train.sh - + - + - + - + @@ -447,13 +430,13 @@ sh scripts/{model_name}/train.sh
- + - + - +
@@ -461,29 +444,32 @@ sh scripts/{model_name}/train.sh
- + - + - +
- + - + - +
-### Wan2.1-Fun-V1.1-14B-Control-Camera && Wan2.1-Fun-V1.1-1.3B-Control-Camera +
+ +
+Wan2.1-Fun-V1.1-14B-Control-Camera && Wan2.1-Fun-V1.1-1.3B-Control-Camera @@ -499,13 +485,13 @@ sh scripts/{model_name}/train.sh @@ -521,34 +507,37 @@ sh scripts/{model_name}/train.sh
- + - + - +
- + - + - +
-### CogVideoX-Fun-V1.1-5B +
+ +
+CogVideoX-Fun-V1.1-5B 解像度-1024
- + - + - + - +
@@ -559,16 +548,16 @@ sh scripts/{model_name}/train.sh
- + - + - + - +
@@ -578,32 +567,35 @@ sh scripts/{model_name}/train.sh
- + - + - + - +
-### CogVideoX-Fun-V1.1-5B-Control +
+ +
+CogVideoX-Fun-V1.1-5B-Control @@ -619,17 +611,19 @@ sh scripts/{model_name}/train.sh
- + - + - +
- + - + - +
+
+ # 五、参考文献 - CogVideo: https://github.com/THUDM/CogVideo/ - EasyAnimate: https://github.com/aigc-apps/EasyAnimate diff --git a/README_zh-CN.md b/README_zh-CN.md index a650030..1ee234c 100755 --- a/README_zh-CN.md +++ b/README_zh-CN.md @@ -334,7 +334,7 @@ sh scripts/{model_name}/train.sh | Phantom | 视频 | 多主体参考生视频的增量权重,基于Wan2.1-T2V |
Phantom-Wan-1.3B🤗-1.3B版,官方以.pth发布,放入Personalized_Model后按预测脚本的transformer_path引用
Phantom-Wan-14B🤗-14B版,官方以分片safetensors发布
| | Qwen-Image | 图片 | 官方文生图与图像编辑权重,支持基线与LoRA训练 |
Qwen-Image🤗🤖文生图基础权重
Qwen-Image-2512🤗🤖文生图更新版本
Qwen-Image-Edit🤗🤖图像编辑
Qwen-Image-Edit-2509🤗🤖图像编辑更新版本
Qwen-Image-Layered🤗🤖图像图层分解权重,可将图像拆分为多个可编辑的RGBA图层
| | Qwen-Image-2.1 | 图片 | 官方新一代文生图权重,单流block-causal结构,支持前缀KV cache |
Qwen-Image-2.1🤗🤖单流block-causal结构,支持全参数训练;前缀KV cache可加速推理
| -| Qwen-Image ControlNet | 图片 | 图片控制生成,支持Canny、Depth、Pose、MLSD、Scribble |
Qwen-Image-2512-Fun-Controlnet-Union🤗🤖本项目训练的ControlNet
Qwen-Image-ControlNet-Union🤗🤖InstantX提供的同类型ControlNet
| +| Qwen-Image ControlNet | 图片 | 图片控制生成,支持Canny、Depth、Pose、MLSD、Scribble |
Qwen-Image-2512-Fun-Controlnet-Union🤗🤖本项目训练的ControlNet
Qwen-Image-2.1-Fun-Controlnet-Union🤗🤖本项目为 Qwen-Image-2.1 训练的 ControlNet-Union,支持 Canny、Depth、Pose、MLSD 等控制条件与图像修复(inpaint)
Qwen-Image-ControlNet-Union🤗🤖InstantX提供的同类型ControlNet
| | Z-Image | 图片 | 官方文生图权重 |
Z-Image🤗🤖基础版
Z-Image-Turbo🤗🤖加速版
| | Z-Image-Fun | 图片 | 本项目在Z-Image上训练的ControlNet与蒸馏LoRA,控制条件支持Canny、Depth、Pose、MLSD、Scribble、Gray |
Z-Image-Fun-Controlnet-Union-2.1🤗🤖基于基础版的ControlNet,2.1版层数更多、训练更充分
Z-Image-Turbo-Fun-Controlnet-Union🤗🤖基于Turbo的ControlNet
Z-Image-Turbo-Fun-Controlnet-Union-2.1🤗🤖基于Turbo的2.1版ControlNet,仓库含多精度文件
Z-Image-Fun-Lora-Distill🤗🤖同时蒸馏步数与CFG,推理仅需8步
| | Flux | 图片 | 官方FLUX.1/FLUX.2权重与本项目训练的ControlNet |
FLUX.1-dev🤗🤖文生图与图像编辑
FLUX.2-dev🤗🤖第二代官方权重
FLUX.2-dev-Fun-Controlnet-Union🤗🤖本项目为FLUX.2-dev训练的ControlNet,支持Canny、Depth、Pose、MLSD等
| @@ -354,16 +354,16 @@ sh scripts/{model_name}/train.sh
- + - + - + - +
@@ -388,16 +388,16 @@ sh scripts/{model_name}/train.sh - + - + - + - + @@ -408,13 +408,13 @@ sh scripts/{model_name}/train.sh
- + - + - +
@@ -422,24 +422,24 @@ sh scripts/{model_name}/train.sh
- + - + - +
- + - + - +
diff --git a/examples/cogvideox_fun/predict_i2v.py b/examples/cogvideox_fun/predict_i2v.py index 92b6702..82617a8 100755 --- a/examples/cogvideox_fun/predict_i2v.py +++ b/examples/cogvideox_fun/predict_i2v.py @@ -317,6 +317,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/cogvideox_fun/predict_t2v.py b/examples/cogvideox_fun/predict_t2v.py index 9f11d4a..b714d7f 100755 --- a/examples/cogvideox_fun/predict_t2v.py +++ b/examples/cogvideox_fun/predict_t2v.py @@ -256,6 +256,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/cogvideox_fun/predict_v2v.py b/examples/cogvideox_fun/predict_v2v.py index 5f895bc..313909e 100755 --- a/examples/cogvideox_fun/predict_v2v.py +++ b/examples/cogvideox_fun/predict_v2v.py @@ -251,6 +251,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/cogvideox_fun/predict_v2v_control.py b/examples/cogvideox_fun/predict_v2v_control.py index 35a5952..3715a80 100755 --- a/examples/cogvideox_fun/predict_v2v_control.py +++ b/examples/cogvideox_fun/predict_v2v_control.py @@ -236,6 +236,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/ernie_image/predict_t2i.py b/examples/ernie_image/predict_t2i.py index 8da5745..a9abeb3 100644 --- a/examples/ernie_image/predict_t2i.py +++ b/examples/ernie_image/predict_t2i.py @@ -201,6 +201,7 @@ def save_results(): video_path = os.path.join(save_path, prefix + ".png") image = sample[0] image.save(video_path) + print(f"Saved image to: {video_path}") if ulysses_degree * ring_degree > 1: import torch.distributed as dist diff --git a/examples/fantasytalking/predict_s2v.py b/examples/fantasytalking/predict_s2v.py index 254eb02..f520bc1 100644 --- a/examples/fantasytalking/predict_s2v.py +++ b/examples/fantasytalking/predict_s2v.py @@ -321,6 +321,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/flashhead/predict_s2v.py b/examples/flashhead/predict_s2v.py index 865dfb4..e53802e 100644 --- a/examples/flashhead/predict_s2v.py +++ b/examples/flashhead/predict_s2v.py @@ -248,6 +248,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/flux/predict_t2i.py b/examples/flux/predict_t2i.py index fe7cf93..03aa6eb 100644 --- a/examples/flux/predict_t2i.py +++ b/examples/flux/predict_t2i.py @@ -161,7 +161,7 @@ if ulysses_degree > 1 or ring_degree > 1: print("Add FSDP DIT") if fsdp_text_encoder: shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=text_encoder.text_model.encoder.layers) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -215,6 +215,7 @@ def save_results(): video_path = os.path.join(save_path, prefix + ".png") image = sample[0] image.save(video_path) + print(f"Saved image to: {video_path}") if ulysses_degree * ring_degree > 1: import torch.distributed as dist diff --git a/examples/flux2/predict_t2i.py b/examples/flux2/predict_t2i.py index 9ba37e4..731d2ab 100644 --- a/examples/flux2/predict_t2i.py +++ b/examples/flux2/predict_t2i.py @@ -156,7 +156,7 @@ if ulysses_degree > 1 or ring_degree > 1: print("Add FSDP DIT") if fsdp_text_encoder: shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=text_encoder.language_model.layers) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -209,6 +209,7 @@ def save_results(): video_path = os.path.join(save_path, prefix + ".png") image = sample[0] image.save(video_path) + print(f"Saved image to: {video_path}") if ulysses_degree * ring_degree > 1: import torch.distributed as dist diff --git a/examples/flux2_fun/predict_i2i_inpaint.py b/examples/flux2_fun/predict_i2i_inpaint.py index 5c0df8d..3764b45 100644 --- a/examples/flux2_fun/predict_i2i_inpaint.py +++ b/examples/flux2_fun/predict_i2i_inpaint.py @@ -172,7 +172,7 @@ if ulysses_degree > 1 or ring_degree > 1: print("Add FSDP DIT") if fsdp_text_encoder: shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=text_encoder.language_model.layers, ignored_modules=[text_encoder.language_model.embed_tokens], transformer_layer_cls_to_wrap=["MistralDecoderLayer", "PixtralTransformer"]) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -249,6 +249,7 @@ def save_results(): video_path = os.path.join(save_path, prefix + ".png") image = sample[0] image.save(video_path) + print(f"Saved image to: {video_path}") if ulysses_degree * ring_degree > 1: import torch.distributed as dist diff --git a/examples/flux2_fun/predict_t2i_control.py b/examples/flux2_fun/predict_t2i_control.py index 6dd9740..0974312 100644 --- a/examples/flux2_fun/predict_t2i_control.py +++ b/examples/flux2_fun/predict_t2i_control.py @@ -172,7 +172,7 @@ if ulysses_degree > 1 or ring_degree > 1: print("Add FSDP DIT") if fsdp_text_encoder: shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=text_encoder.language_model.layers, ignored_modules=[text_encoder.language_model.embed_tokens], transformer_layer_cls_to_wrap=["MistralDecoderLayer", "PixtralTransformer"]) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -249,6 +249,7 @@ def save_results(): video_path = os.path.join(save_path, prefix + ".png") image = sample[0] image.save(video_path) + print(f"Saved image to: {video_path}") if ulysses_degree * ring_degree > 1: import torch.distributed as dist diff --git a/examples/flux2_fun/predict_t2i_control_ref.py b/examples/flux2_fun/predict_t2i_control_ref.py index 106b525..d02e9c0 100644 --- a/examples/flux2_fun/predict_t2i_control_ref.py +++ b/examples/flux2_fun/predict_t2i_control_ref.py @@ -172,7 +172,7 @@ if ulysses_degree > 1 or ring_degree > 1: print("Add FSDP DIT") if fsdp_text_encoder: shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=text_encoder.language_model.layers, ignored_modules=[text_encoder.language_model.embed_tokens], transformer_layer_cls_to_wrap=["MistralDecoderLayer", "PixtralTransformer"]) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -249,6 +249,7 @@ def save_results(): video_path = os.path.join(save_path, prefix + ".png") image = sample[0] image.save(video_path) + print(f"Saved image to: {video_path}") if ulysses_degree * ring_degree > 1: import torch.distributed as dist diff --git a/examples/hunyuanvideo/predict_i2v.py b/examples/hunyuanvideo/predict_i2v.py index bd5be20..743ebba 100644 --- a/examples/hunyuanvideo/predict_i2v.py +++ b/examples/hunyuanvideo/predict_i2v.py @@ -258,6 +258,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/hunyuanvideo/predict_t2v.py b/examples/hunyuanvideo/predict_t2v.py index 8f6f516..867fb47 100644 --- a/examples/hunyuanvideo/predict_t2v.py +++ b/examples/hunyuanvideo/predict_t2v.py @@ -243,6 +243,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/infinitetalk/predict_s2v.py b/examples/infinitetalk/predict_s2v.py index 1630902..e15af74 100644 --- a/examples/infinitetalk/predict_s2v.py +++ b/examples/infinitetalk/predict_s2v.py @@ -305,6 +305,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/lens/predict_t2i.py b/examples/lens/predict_t2i.py index b2fa693..1785edd 100644 --- a/examples/lens/predict_t2i.py +++ b/examples/lens/predict_t2i.py @@ -217,6 +217,7 @@ def save_results(): video_path = os.path.join(save_path, prefix + ".png") image = sample[0] image.save(video_path) + print(f"Saved image to: {video_path}") if ulysses_degree * ring_degree > 1: import torch.distributed as dist diff --git a/examples/lingbot_video/predict_i2v.py b/examples/lingbot_video/predict_i2v.py index e90f888..218cc97 100644 --- a/examples/lingbot_video/predict_i2v.py +++ b/examples/lingbot_video/predict_i2v.py @@ -241,6 +241,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/lingbot_video/predict_t2v.py b/examples/lingbot_video/predict_t2v.py index cb49ca9..90d956a 100644 --- a/examples/lingbot_video/predict_t2v.py +++ b/examples/lingbot_video/predict_t2v.py @@ -242,6 +242,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/lingbot_world/predict_i2v.py b/examples/lingbot_world/predict_i2v.py index 196e094..f60bb12 100644 --- a/examples/lingbot_world/predict_i2v.py +++ b/examples/lingbot_world/predict_i2v.py @@ -360,6 +360,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/longcatvideo/predict_i2v.py b/examples/longcatvideo/predict_i2v.py index ee8955d..3f54955 100644 --- a/examples/longcatvideo/predict_i2v.py +++ b/examples/longcatvideo/predict_i2v.py @@ -235,6 +235,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/longcatvideo/predict_s2v_avatar.py b/examples/longcatvideo/predict_s2v_avatar.py index 70ce242..65cad64 100644 --- a/examples/longcatvideo/predict_s2v_avatar.py +++ b/examples/longcatvideo/predict_s2v_avatar.py @@ -279,6 +279,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/longcatvideo/predict_t2v.py b/examples/longcatvideo/predict_t2v.py index 8b99e1b..62315c9 100644 --- a/examples/longcatvideo/predict_t2v.py +++ b/examples/longcatvideo/predict_t2v.py @@ -227,6 +227,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/ltx2.3/predict_i2v.py b/examples/ltx2.3/predict_i2v.py index 87dbb5e..4611911 100644 --- a/examples/ltx2.3/predict_i2v.py +++ b/examples/ltx2.3/predict_i2v.py @@ -218,7 +218,7 @@ if ulysses_degree > 1 or ring_degree > 1: if fsdp_text_encoder: shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=text_encoder.language_model.layers) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -292,6 +292,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") sr = getattr(pipeline.vocoder.config, "output_sampling_rate", audio_sample_rate) diff --git a/examples/ltx2.3/predict_t2v.py b/examples/ltx2.3/predict_t2v.py index ae05f06..c87da72 100644 --- a/examples/ltx2.3/predict_t2v.py +++ b/examples/ltx2.3/predict_t2v.py @@ -214,7 +214,7 @@ if ulysses_degree > 1 or ring_degree > 1: if fsdp_text_encoder: shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=text_encoder.language_model.layers) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -287,6 +287,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") sr = getattr(pipeline.vocoder.config, "output_sampling_rate", audio_sample_rate) diff --git a/examples/ltx2/predict_i2v.py b/examples/ltx2/predict_i2v.py index ac1fc21..890f9fe 100644 --- a/examples/ltx2/predict_i2v.py +++ b/examples/ltx2/predict_i2v.py @@ -202,7 +202,7 @@ if ulysses_degree > 1 or ring_degree > 1: if fsdp_text_encoder: shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=text_encoder.language_model.layers) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -268,6 +268,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") sr = getattr(pipeline.vocoder.config, "output_sampling_rate", audio_sample_rate) diff --git a/examples/ltx2/predict_i2v_upsample.py b/examples/ltx2/predict_i2v_upsample.py index 2c30937..efb427a 100644 --- a/examples/ltx2/predict_i2v_upsample.py +++ b/examples/ltx2/predict_i2v_upsample.py @@ -206,7 +206,7 @@ if ulysses_degree > 1 or ring_degree > 1: if fsdp_text_encoder: shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=text_encoder.language_model.layers) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -313,6 +313,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") sr = getattr(pipeline.vocoder.config, "output_sampling_rate", audio_sample_rate) diff --git a/examples/ltx2/predict_t2v.py b/examples/ltx2/predict_t2v.py index 03c8ee8..6f65a04 100644 --- a/examples/ltx2/predict_t2v.py +++ b/examples/ltx2/predict_t2v.py @@ -198,7 +198,7 @@ if ulysses_degree > 1 or ring_degree > 1: if fsdp_text_encoder: shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=text_encoder.language_model.layers) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -263,6 +263,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") sr = getattr(pipeline.vocoder.config, "output_sampling_rate", audio_sample_rate) diff --git a/examples/mova/predict_i2v.py b/examples/mova/predict_i2v.py index ea9a9c5..5254b67 100644 --- a/examples/mova/predict_i2v.py +++ b/examples/mova/predict_i2v.py @@ -367,6 +367,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") sr = getattr(pipeline.audio_vae.config, "output_sampling_rate", audio_sample_rate) diff --git a/examples/phantom/predict_s2v.py b/examples/phantom/predict_s2v.py index 28314f1..d5f22e0 100644 --- a/examples/phantom/predict_s2v.py +++ b/examples/phantom/predict_s2v.py @@ -296,6 +296,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/qwenimage/predict_i2i_layered.py b/examples/qwenimage/predict_i2i_layered.py index 307a2d6..1c8dcee 100644 --- a/examples/qwenimage/predict_i2i_layered.py +++ b/examples/qwenimage/predict_i2i_layered.py @@ -184,7 +184,7 @@ if ulysses_degree > 1 or ring_degree > 1: from videox_fun.dist import set_multi_gpus_devices, shard_model shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=text_encoder.language_model.layers) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -254,6 +254,7 @@ def save_results(): prefix = str(index).zfill(8) video_path = os.path.join(save_path, prefix + ".png") _image.save(video_path) + print(f"Saved image to: {video_path}") if ulysses_degree * ring_degree > 1: import torch.distributed as dist diff --git a/examples/qwenimage/predict_t2i.py b/examples/qwenimage/predict_t2i.py index e77ec6f..ab2e8f0 100644 --- a/examples/qwenimage/predict_t2i.py +++ b/examples/qwenimage/predict_t2i.py @@ -172,7 +172,7 @@ if ulysses_degree > 1 or ring_degree > 1: from functools import partial from videox_fun.dist import set_multi_gpus_devices, shard_model shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=text_encoder.language_model.layers) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -237,6 +237,7 @@ def save_results(): video_path = os.path.join(save_path, prefix + ".png") image = sample[0] image.save(video_path) + print(f"Saved image to: {video_path}") if ulysses_degree * ring_degree > 1: import torch.distributed as dist diff --git a/examples/qwenimage/predict_t2i_edit.py b/examples/qwenimage/predict_t2i_edit.py index 6b4c6d3..1030eca 100644 --- a/examples/qwenimage/predict_t2i_edit.py +++ b/examples/qwenimage/predict_t2i_edit.py @@ -183,7 +183,7 @@ if ulysses_degree > 1 or ring_degree > 1: from videox_fun.dist import set_multi_gpus_devices, shard_model shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=text_encoder.language_model.layers) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -253,6 +253,7 @@ def save_results(): video_path = os.path.join(save_path, prefix + ".png") image = sample[0] image.save(video_path) + print(f"Saved image to: {video_path}") if ulysses_degree * ring_degree > 1: import torch.distributed as dist diff --git a/examples/qwenimage/predict_t2i_edit_plus.py b/examples/qwenimage/predict_t2i_edit_plus.py index 60a60ea..f2a0e09 100644 --- a/examples/qwenimage/predict_t2i_edit_plus.py +++ b/examples/qwenimage/predict_t2i_edit_plus.py @@ -183,7 +183,7 @@ if ulysses_degree > 1 or ring_degree > 1: from videox_fun.dist import set_multi_gpus_devices, shard_model shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=text_encoder.language_model.layers) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -253,6 +253,7 @@ def save_results(): video_path = os.path.join(save_path, prefix + ".png") image = sample[0] image.save(video_path) + print(f"Saved image to: {video_path}") if ulysses_degree * ring_degree > 1: import torch.distributed as dist diff --git a/examples/qwenimage21/predict_t2i.py b/examples/qwenimage21/predict_t2i.py index 3e016af..db65611 100644 --- a/examples/qwenimage21/predict_t2i.py +++ b/examples/qwenimage21/predict_t2i.py @@ -158,7 +158,7 @@ if ulysses_degree > 1 or ring_degree > 1: from functools import partial from videox_fun.dist import set_multi_gpus_devices, shard_model shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=text_encoder.model.language_model.layers) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -214,6 +214,7 @@ for prompt in prompts: image_path = os.path.join(save_path, prefix + ".png") image = sample[0] image.save(image_path) + print(f"Saved image to: {image_path}") if ulysses_degree * ring_degree > 1: import torch.distributed as dist diff --git a/examples/qwenimage21_fun/predict_i2i_inpaint.py b/examples/qwenimage21_fun/predict_i2i_inpaint.py index 2752d98..372589a 100644 --- a/examples/qwenimage21_fun/predict_i2i_inpaint.py +++ b/examples/qwenimage21_fun/predict_i2i_inpaint.py @@ -251,6 +251,7 @@ def save_results(): image_path = os.path.join(save_path, prefix + ".png") image = sample[0] image.save(image_path) + print(f"Saved image to: {image_path}") if ulysses_degree * ring_degree > 1: import torch.distributed as dist diff --git a/examples/qwenimage21_fun/predict_t2i_control.py b/examples/qwenimage21_fun/predict_t2i_control.py index 0023270..16b6bb6 100644 --- a/examples/qwenimage21_fun/predict_t2i_control.py +++ b/examples/qwenimage21_fun/predict_t2i_control.py @@ -232,6 +232,7 @@ def save_results(): image_path = os.path.join(save_path, prefix + f"-{control_context_scale}.png") image = sample[0] image.save(image_path) + print(f"Saved image to: {image_path}") if ulysses_degree * ring_degree > 1: import torch.distributed as dist diff --git a/examples/qwenimage_fun/predict_i2i_inpaint.py b/examples/qwenimage_fun/predict_i2i_inpaint.py index e7722b4..4468f5b 100644 --- a/examples/qwenimage_fun/predict_i2i_inpaint.py +++ b/examples/qwenimage_fun/predict_i2i_inpaint.py @@ -185,7 +185,7 @@ if ulysses_degree > 1 or ring_degree > 1: from videox_fun.dist import set_multi_gpus_devices, shard_model shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=text_encoder.language_model.layers) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -268,6 +268,7 @@ def save_results(): image_path = os.path.join(save_path, prefix + ".png") image = sample[0] image.save(image_path) + print(f"Saved image to: {image_path}") if ulysses_degree * ring_degree > 1: import torch.distributed as dist diff --git a/examples/qwenimage_fun/predict_t2i_control.py b/examples/qwenimage_fun/predict_t2i_control.py index 828748b..aa5812b 100644 --- a/examples/qwenimage_fun/predict_t2i_control.py +++ b/examples/qwenimage_fun/predict_t2i_control.py @@ -185,7 +185,7 @@ if ulysses_degree > 1 or ring_degree > 1: from videox_fun.dist import set_multi_gpus_devices, shard_model shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=text_encoder.language_model.layers) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -268,6 +268,7 @@ def save_results(): image_path = os.path.join(save_path, prefix + ".png") image = sample[0] image.save(image_path) + print(f"Saved image to: {image_path}") if ulysses_degree * ring_degree > 1: import torch.distributed as dist diff --git a/examples/qwenimage_instantx/predict_t2i_control.py b/examples/qwenimage_instantx/predict_t2i_control.py index d64155b..68da506 100644 --- a/examples/qwenimage_instantx/predict_t2i_control.py +++ b/examples/qwenimage_instantx/predict_t2i_control.py @@ -202,7 +202,7 @@ if ulysses_degree > 1 or ring_degree > 1: from functools import partial from videox_fun.dist import set_multi_gpus_devices, shard_model shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=text_encoder.language_model.layers) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -272,6 +272,7 @@ def save_results(): image_path = os.path.join(save_path, prefix + ".png") image = sample[0] image.save(image_path) + print(f"Saved image to: {image_path}") if ulysses_degree * ring_degree > 1: import torch.distributed as dist diff --git a/examples/turbodiffusion/predict_i2v_wan2.2.py b/examples/turbodiffusion/predict_i2v_wan2.2.py index 76cc736..1d79374 100644 --- a/examples/turbodiffusion/predict_i2v_wan2.2.py +++ b/examples/turbodiffusion/predict_i2v_wan2.2.py @@ -314,6 +314,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/turbodiffusion/predict_t2v_wan2.1.py b/examples/turbodiffusion/predict_t2v_wan2.1.py index 74c915f..343ff94 100644 --- a/examples/turbodiffusion/predict_t2v_wan2.1.py +++ b/examples/turbodiffusion/predict_t2v_wan2.1.py @@ -256,6 +256,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.1/predict_i2v.py b/examples/wan2.1/predict_i2v.py index 2f56563..9351559 100755 --- a/examples/wan2.1/predict_i2v.py +++ b/examples/wan2.1/predict_i2v.py @@ -298,6 +298,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.1/predict_i2v_tae.py b/examples/wan2.1/predict_i2v_tae.py index cc87e36..eaad890 100644 --- a/examples/wan2.1/predict_i2v_tae.py +++ b/examples/wan2.1/predict_i2v_tae.py @@ -323,6 +323,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.1/predict_t2v.py b/examples/wan2.1/predict_t2v.py index c50db5f..043737c 100755 --- a/examples/wan2.1/predict_t2v.py +++ b/examples/wan2.1/predict_t2v.py @@ -279,6 +279,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.1/predict_t2v_tae.py b/examples/wan2.1/predict_t2v_tae.py index c4971b7..742868e 100644 --- a/examples/wan2.1/predict_t2v_tae.py +++ b/examples/wan2.1/predict_t2v_tae.py @@ -304,6 +304,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.1_causal_forcing/predict_t2v.py b/examples/wan2.1_causal_forcing/predict_t2v.py index 77561bb..f191947 100644 --- a/examples/wan2.1_causal_forcing/predict_t2v.py +++ b/examples/wan2.1_causal_forcing/predict_t2v.py @@ -316,6 +316,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.1_causal_forcing/predict_t2v_stream.py b/examples/wan2.1_causal_forcing/predict_t2v_stream.py index dc65e16..5976180 100644 --- a/examples/wan2.1_causal_forcing/predict_t2v_stream.py +++ b/examples/wan2.1_causal_forcing/predict_t2v_stream.py @@ -363,6 +363,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.1_flex_forcing/predict_t2v.py b/examples/wan2.1_flex_forcing/predict_t2v.py index ea86636..293f1dc 100644 --- a/examples/wan2.1_flex_forcing/predict_t2v.py +++ b/examples/wan2.1_flex_forcing/predict_t2v.py @@ -331,6 +331,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.1_flex_forcing/predict_t2v_edit.py b/examples/wan2.1_flex_forcing/predict_t2v_edit.py index 573a361..d2d8aa9 100644 --- a/examples/wan2.1_flex_forcing/predict_t2v_edit.py +++ b/examples/wan2.1_flex_forcing/predict_t2v_edit.py @@ -345,6 +345,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(image_path) + print(f"Saved image to: {image_path}") else: video_path = os.path.join(save_path, prefix + "-edited.mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.1_fun/predict_i2v.py b/examples/wan2.1_fun/predict_i2v.py index fb36ce5..92e440d 100755 --- a/examples/wan2.1_fun/predict_i2v.py +++ b/examples/wan2.1_fun/predict_i2v.py @@ -299,6 +299,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.1_fun/predict_t2v.py b/examples/wan2.1_fun/predict_t2v.py index dd1c07c..5184377 100755 --- a/examples/wan2.1_fun/predict_t2v.py +++ b/examples/wan2.1_fun/predict_t2v.py @@ -318,6 +318,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.1_fun/predict_v2v_control.py b/examples/wan2.1_fun/predict_v2v_control.py index 6d5514d..c9644fa 100755 --- a/examples/wan2.1_fun/predict_v2v_control.py +++ b/examples/wan2.1_fun/predict_v2v_control.py @@ -329,6 +329,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.1_fun/predict_v2v_control_camera.py b/examples/wan2.1_fun/predict_v2v_control_camera.py index 39ed5cb..b4a8cad 100755 --- a/examples/wan2.1_fun/predict_v2v_control_camera.py +++ b/examples/wan2.1_fun/predict_v2v_control_camera.py @@ -330,6 +330,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.1_fun/predict_v2v_control_ref.py b/examples/wan2.1_fun/predict_v2v_control_ref.py index 7acbef4..3e6b2d9 100755 --- a/examples/wan2.1_fun/predict_v2v_control_ref.py +++ b/examples/wan2.1_fun/predict_v2v_control_ref.py @@ -330,6 +330,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.1_self_forcing/predict_t2v.py b/examples/wan2.1_self_forcing/predict_t2v.py index f895b50..07d8119 100644 --- a/examples/wan2.1_self_forcing/predict_t2v.py +++ b/examples/wan2.1_self_forcing/predict_t2v.py @@ -262,6 +262,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.1_self_forcing/predict_t2v_forcing_kv.py b/examples/wan2.1_self_forcing/predict_t2v_forcing_kv.py index 7662a41..c9fbb90 100644 --- a/examples/wan2.1_self_forcing/predict_t2v_forcing_kv.py +++ b/examples/wan2.1_self_forcing/predict_t2v_forcing_kv.py @@ -325,6 +325,7 @@ for prompt in prompts: image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.1_self_forcing/predict_t2v_stream.py b/examples/wan2.1_self_forcing/predict_t2v_stream.py index 5aefeb5..94dd523 100644 --- a/examples/wan2.1_self_forcing/predict_t2v_stream.py +++ b/examples/wan2.1_self_forcing/predict_t2v_stream.py @@ -309,6 +309,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.1_vace/predict_i2v.py b/examples/wan2.1_vace/predict_i2v.py index f121e8f..883e3f9 100644 --- a/examples/wan2.1_vace/predict_i2v.py +++ b/examples/wan2.1_vace/predict_i2v.py @@ -308,6 +308,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.1_vace/predict_s2v.py b/examples/wan2.1_vace/predict_s2v.py index 6cfaa76..37e2b98 100644 --- a/examples/wan2.1_vace/predict_s2v.py +++ b/examples/wan2.1_vace/predict_s2v.py @@ -308,6 +308,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.1_vace/predict_v2v_control.py b/examples/wan2.1_vace/predict_v2v_control.py index 09c2b9a..73294e3 100644 --- a/examples/wan2.1_vace/predict_v2v_control.py +++ b/examples/wan2.1_vace/predict_v2v_control.py @@ -308,6 +308,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.2/predict_animate.py b/examples/wan2.2/predict_animate.py index 6ea3153..4805158 100644 --- a/examples/wan2.2/predict_animate.py +++ b/examples/wan2.2/predict_animate.py @@ -380,6 +380,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.2/predict_i2v.py b/examples/wan2.2/predict_i2v.py index d883a57..573249e 100644 --- a/examples/wan2.2/predict_i2v.py +++ b/examples/wan2.2/predict_i2v.py @@ -351,6 +351,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.2/predict_s2v.py b/examples/wan2.2/predict_s2v.py index 7eba067..05f9d92 100644 --- a/examples/wan2.2/predict_s2v.py +++ b/examples/wan2.2/predict_s2v.py @@ -373,6 +373,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.2/predict_t2v.py b/examples/wan2.2/predict_t2v.py index 2c2d238..f3f7bce 100755 --- a/examples/wan2.2/predict_t2v.py +++ b/examples/wan2.2/predict_t2v.py @@ -341,6 +341,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.2/predict_ti2v.py b/examples/wan2.2/predict_ti2v.py index 380d4d2..a02ab9f 100755 --- a/examples/wan2.2/predict_ti2v.py +++ b/examples/wan2.2/predict_ti2v.py @@ -355,6 +355,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.2/predict_ti2v_tae.py b/examples/wan2.2/predict_ti2v_tae.py index 89700d1..1bff31a 100644 --- a/examples/wan2.2/predict_ti2v_tae.py +++ b/examples/wan2.2/predict_ti2v_tae.py @@ -372,6 +372,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.2_fun/predict_i2v.py b/examples/wan2.2_fun/predict_i2v.py index d6bba17..a9c13a6 100644 --- a/examples/wan2.2_fun/predict_i2v.py +++ b/examples/wan2.2_fun/predict_i2v.py @@ -354,6 +354,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.2_fun/predict_i2v_2.2vae.py b/examples/wan2.2_fun/predict_i2v_2.2vae.py index 9b9e254..51e5e3a 100644 --- a/examples/wan2.2_fun/predict_i2v_2.2vae.py +++ b/examples/wan2.2_fun/predict_i2v_2.2vae.py @@ -403,6 +403,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.2_fun/predict_i2v_2.2vae_tae.py b/examples/wan2.2_fun/predict_i2v_2.2vae_tae.py index fda880f..711a968 100644 --- a/examples/wan2.2_fun/predict_i2v_2.2vae_tae.py +++ b/examples/wan2.2_fun/predict_i2v_2.2vae_tae.py @@ -417,6 +417,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.2_fun/predict_i2v_5b.py b/examples/wan2.2_fun/predict_i2v_5b.py index 9922d46..d271584 100644 --- a/examples/wan2.2_fun/predict_i2v_5b.py +++ b/examples/wan2.2_fun/predict_i2v_5b.py @@ -356,6 +356,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.2_fun/predict_t2v.py b/examples/wan2.2_fun/predict_t2v.py index c68e0f5..a0462d1 100644 --- a/examples/wan2.2_fun/predict_t2v.py +++ b/examples/wan2.2_fun/predict_t2v.py @@ -350,6 +350,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.2_fun/predict_t2v_2.2vae.py b/examples/wan2.2_fun/predict_t2v_2.2vae.py index 51d85f8..d12faca 100644 --- a/examples/wan2.2_fun/predict_t2v_2.2vae.py +++ b/examples/wan2.2_fun/predict_t2v_2.2vae.py @@ -394,6 +394,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.2_fun/predict_t2v_2.2vae_tae.py b/examples/wan2.2_fun/predict_t2v_2.2vae_tae.py index 2cc2ba0..c135248 100644 --- a/examples/wan2.2_fun/predict_t2v_2.2vae_tae.py +++ b/examples/wan2.2_fun/predict_t2v_2.2vae_tae.py @@ -409,6 +409,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.2_fun/predict_t2v_5b.py b/examples/wan2.2_fun/predict_t2v_5b.py index c4aa514..ec52330 100644 --- a/examples/wan2.2_fun/predict_t2v_5b.py +++ b/examples/wan2.2_fun/predict_t2v_5b.py @@ -350,6 +350,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.2_fun/predict_v2v_control.py b/examples/wan2.2_fun/predict_v2v_control.py index 0d076b6..2dbd8ec 100644 --- a/examples/wan2.2_fun/predict_v2v_control.py +++ b/examples/wan2.2_fun/predict_v2v_control.py @@ -381,6 +381,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.2_fun/predict_v2v_control_5b.py b/examples/wan2.2_fun/predict_v2v_control_5b.py index 7c78666..763bebd 100644 --- a/examples/wan2.2_fun/predict_v2v_control_5b.py +++ b/examples/wan2.2_fun/predict_v2v_control_5b.py @@ -381,6 +381,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.2_fun/predict_v2v_control_camera.py b/examples/wan2.2_fun/predict_v2v_control_camera.py index 3ec8e52..31f93bd 100644 --- a/examples/wan2.2_fun/predict_v2v_control_camera.py +++ b/examples/wan2.2_fun/predict_v2v_control_camera.py @@ -381,6 +381,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.2_fun/predict_v2v_control_camera_5b.py b/examples/wan2.2_fun/predict_v2v_control_camera_5b.py index ee36ab0..3361799 100644 --- a/examples/wan2.2_fun/predict_v2v_control_camera_5b.py +++ b/examples/wan2.2_fun/predict_v2v_control_camera_5b.py @@ -381,6 +381,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.2_fun/predict_v2v_control_ref.py b/examples/wan2.2_fun/predict_v2v_control_ref.py index 43906df..214ba1a 100644 --- a/examples/wan2.2_fun/predict_v2v_control_ref.py +++ b/examples/wan2.2_fun/predict_v2v_control_ref.py @@ -381,6 +381,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.2_fun/predict_v2v_control_ref_5b.py b/examples/wan2.2_fun/predict_v2v_control_ref_5b.py index 7d1c2c3..05f4a20 100644 --- a/examples/wan2.2_fun/predict_v2v_control_ref_5b.py +++ b/examples/wan2.2_fun/predict_v2v_control_ref_5b.py @@ -381,6 +381,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.2_vace_fun/predict_i2v.py b/examples/wan2.2_vace_fun/predict_i2v.py index fa18f3c..bef08d7 100644 --- a/examples/wan2.2_vace_fun/predict_i2v.py +++ b/examples/wan2.2_vace_fun/predict_i2v.py @@ -387,6 +387,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.2_vace_fun/predict_s2v.py b/examples/wan2.2_vace_fun/predict_s2v.py index 9ff65a5..ba78006 100644 --- a/examples/wan2.2_vace_fun/predict_s2v.py +++ b/examples/wan2.2_vace_fun/predict_s2v.py @@ -387,6 +387,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.2_vace_fun/predict_v2v_control.py b/examples/wan2.2_vace_fun/predict_v2v_control.py index 5a22716..7152e0d 100644 --- a/examples/wan2.2_vace_fun/predict_v2v_control.py +++ b/examples/wan2.2_vace_fun/predict_v2v_control.py @@ -387,6 +387,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.2_vace_fun/predict_v2v_control_ref.py b/examples/wan2.2_vace_fun/predict_v2v_control_ref.py index e9a557f..1c0c4d1 100644 --- a/examples/wan2.2_vace_fun/predict_v2v_control_ref.py +++ b/examples/wan2.2_vace_fun/predict_v2v_control_ref.py @@ -387,6 +387,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/wan2.2_vace_fun/predict_v2v_mask.py b/examples/wan2.2_vace_fun/predict_v2v_mask.py index b25eb5b..5b71c09 100644 --- a/examples/wan2.2_vace_fun/predict_v2v_mask.py +++ b/examples/wan2.2_vace_fun/predict_v2v_mask.py @@ -387,6 +387,7 @@ def save_results(): image = (image * 255).numpy().astype(np.uint8) image = Image.fromarray(image) image.save(video_path) + print(f"Saved image to: {video_path}") else: video_path = os.path.join(save_path, prefix + ".mp4") save_videos_grid(sample, video_path, fps=fps) diff --git a/examples/z_image/predict_t2i.py b/examples/z_image/predict_t2i.py index c0e945f..a24ac76 100644 --- a/examples/z_image/predict_t2i.py +++ b/examples/z_image/predict_t2i.py @@ -154,7 +154,7 @@ if ulysses_degree > 1 or ring_degree > 1: print("Add FSDP DIT") if fsdp_text_encoder: shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=list(text_encoder.model.layers)) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -207,6 +207,7 @@ def save_results(): video_path = os.path.join(save_path, prefix + ".png") image = sample[0] image.save(video_path) + print(f"Saved image to: {video_path}") if ulysses_degree * ring_degree > 1: import torch.distributed as dist diff --git a/examples/z_image/predict_turbo_t2i.py b/examples/z_image/predict_turbo_t2i.py index b391686..ffe2737 100644 --- a/examples/z_image/predict_turbo_t2i.py +++ b/examples/z_image/predict_turbo_t2i.py @@ -154,7 +154,7 @@ if ulysses_degree > 1 or ring_degree > 1: print("Add FSDP DIT") if fsdp_text_encoder: shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=list(text_encoder.model.layers)) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -207,6 +207,7 @@ def save_results(): video_path = os.path.join(save_path, prefix + ".png") image = sample[0] image.save(video_path) + print(f"Saved image to: {video_path}") if ulysses_degree * ring_degree > 1: import torch.distributed as dist diff --git a/examples/z_image_fun/predict_i2i_inpaint_2.1.py b/examples/z_image_fun/predict_i2i_inpaint_2.1.py index 9d3996b..afedf83 100644 --- a/examples/z_image_fun/predict_i2i_inpaint_2.1.py +++ b/examples/z_image_fun/predict_i2i_inpaint_2.1.py @@ -170,7 +170,7 @@ if ulysses_degree > 1 or ring_degree > 1: print("Add FSDP DIT") if fsdp_text_encoder: shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=list(text_encoder.model.layers)) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -241,6 +241,7 @@ def save_results(): video_path = os.path.join(save_path, prefix + ".png") image = sample[0] image.save(video_path) + print(f"Saved image to: {video_path}") if ulysses_degree * ring_degree > 1: import torch.distributed as dist diff --git a/examples/z_image_fun/predict_i2i_inpaint_2.1_lite.py b/examples/z_image_fun/predict_i2i_inpaint_2.1_lite.py index da5445a..ff2ead9 100644 --- a/examples/z_image_fun/predict_i2i_inpaint_2.1_lite.py +++ b/examples/z_image_fun/predict_i2i_inpaint_2.1_lite.py @@ -170,7 +170,7 @@ if ulysses_degree > 1 or ring_degree > 1: print("Add FSDP DIT") if fsdp_text_encoder: shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=list(text_encoder.model.layers)) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -241,6 +241,7 @@ def save_results(): video_path = os.path.join(save_path, prefix + ".png") image = sample[0] image.save(video_path) + print(f"Saved image to: {video_path}") if ulysses_degree * ring_degree > 1: import torch.distributed as dist diff --git a/examples/z_image_fun/predict_i2i_tile_2.1.py b/examples/z_image_fun/predict_i2i_tile_2.1.py index c34c08f..08bbaa3 100644 --- a/examples/z_image_fun/predict_i2i_tile_2.1.py +++ b/examples/z_image_fun/predict_i2i_tile_2.1.py @@ -171,7 +171,7 @@ if ulysses_degree > 1 or ring_degree > 1: print("Add FSDP DIT") if fsdp_text_encoder: shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=list(text_encoder.model.layers)) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -242,6 +242,7 @@ def save_results(): video_path = os.path.join(save_path, prefix + ".png") image = sample[0] image.save(video_path) + print(f"Saved image to: {video_path}") if ulysses_degree * ring_degree > 1: import torch.distributed as dist diff --git a/examples/z_image_fun/predict_i2i_tile_2.1_lite.py b/examples/z_image_fun/predict_i2i_tile_2.1_lite.py index be6a7b1..1d45e9a 100644 --- a/examples/z_image_fun/predict_i2i_tile_2.1_lite.py +++ b/examples/z_image_fun/predict_i2i_tile_2.1_lite.py @@ -171,7 +171,7 @@ if ulysses_degree > 1 or ring_degree > 1: print("Add FSDP DIT") if fsdp_text_encoder: shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=list(text_encoder.model.layers)) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -242,6 +242,7 @@ def save_results(): video_path = os.path.join(save_path, prefix + ".png") image = sample[0] image.save(video_path) + print(f"Saved image to: {video_path}") if ulysses_degree * ring_degree > 1: import torch.distributed as dist diff --git a/examples/z_image_fun/predict_t2i_control_2.1.py b/examples/z_image_fun/predict_t2i_control_2.1.py index a707129..7999bf2 100644 --- a/examples/z_image_fun/predict_t2i_control_2.1.py +++ b/examples/z_image_fun/predict_t2i_control_2.1.py @@ -178,7 +178,7 @@ if ulysses_degree > 1 or ring_degree > 1: print("Add FSDP DIT") if fsdp_text_encoder: shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=list(text_encoder.model.layers)) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -249,6 +249,7 @@ def save_results(): video_path = os.path.join(save_path, prefix + ".png") image = sample[0] image.save(video_path) + print(f"Saved image to: {video_path}") if ulysses_degree * ring_degree > 1: import torch.distributed as dist diff --git a/examples/z_image_fun/predict_t2i_control_2.1_lite.py b/examples/z_image_fun/predict_t2i_control_2.1_lite.py index a4c348f..1e1aa08 100644 --- a/examples/z_image_fun/predict_t2i_control_2.1_lite.py +++ b/examples/z_image_fun/predict_t2i_control_2.1_lite.py @@ -178,7 +178,7 @@ if ulysses_degree > 1 or ring_degree > 1: print("Add FSDP DIT") if fsdp_text_encoder: shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=list(text_encoder.model.layers)) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -249,6 +249,7 @@ def save_results(): video_path = os.path.join(save_path, prefix + ".png") image = sample[0] image.save(video_path) + print(f"Saved image to: {video_path}") if ulysses_degree * ring_degree > 1: import torch.distributed as dist diff --git a/examples/z_image_fun/predict_turbo_i2i_inpaint_2.0.py b/examples/z_image_fun/predict_turbo_i2i_inpaint_2.0.py index 9d754db..514f3e1 100644 --- a/examples/z_image_fun/predict_turbo_i2i_inpaint_2.0.py +++ b/examples/z_image_fun/predict_turbo_i2i_inpaint_2.0.py @@ -170,7 +170,7 @@ if ulysses_degree > 1 or ring_degree > 1: print("Add FSDP DIT") if fsdp_text_encoder: shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=list(text_encoder.model.layers)) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -241,6 +241,7 @@ def save_results(): video_path = os.path.join(save_path, prefix + ".png") image = sample[0] image.save(video_path) + print(f"Saved image to: {video_path}") if ulysses_degree * ring_degree > 1: import torch.distributed as dist diff --git a/examples/z_image_fun/predict_turbo_i2i_inpaint_2.1.py b/examples/z_image_fun/predict_turbo_i2i_inpaint_2.1.py index 69b4fd6..ceaaac1 100644 --- a/examples/z_image_fun/predict_turbo_i2i_inpaint_2.1.py +++ b/examples/z_image_fun/predict_turbo_i2i_inpaint_2.1.py @@ -170,7 +170,7 @@ if ulysses_degree > 1 or ring_degree > 1: print("Add FSDP DIT") if fsdp_text_encoder: shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=list(text_encoder.model.layers)) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -241,6 +241,7 @@ def save_results(): video_path = os.path.join(save_path, prefix + ".png") image = sample[0] image.save(video_path) + print(f"Saved image to: {video_path}") if ulysses_degree * ring_degree > 1: import torch.distributed as dist diff --git a/examples/z_image_fun/predict_turbo_i2i_inpaint_2.1_lite.py b/examples/z_image_fun/predict_turbo_i2i_inpaint_2.1_lite.py index 0007a1e..ac5f075 100644 --- a/examples/z_image_fun/predict_turbo_i2i_inpaint_2.1_lite.py +++ b/examples/z_image_fun/predict_turbo_i2i_inpaint_2.1_lite.py @@ -170,7 +170,7 @@ if ulysses_degree > 1 or ring_degree > 1: print("Add FSDP DIT") if fsdp_text_encoder: shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=list(text_encoder.model.layers)) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -241,6 +241,7 @@ def save_results(): video_path = os.path.join(save_path, prefix + ".png") image = sample[0] image.save(video_path) + print(f"Saved image to: {video_path}") if ulysses_degree * ring_degree > 1: import torch.distributed as dist diff --git a/examples/z_image_fun/predict_turbo_i2i_tile_2.1.py b/examples/z_image_fun/predict_turbo_i2i_tile_2.1.py index 055c826..1dcb8e2 100644 --- a/examples/z_image_fun/predict_turbo_i2i_tile_2.1.py +++ b/examples/z_image_fun/predict_turbo_i2i_tile_2.1.py @@ -171,7 +171,7 @@ if ulysses_degree > 1 or ring_degree > 1: print("Add FSDP DIT") if fsdp_text_encoder: shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=list(text_encoder.model.layers)) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -242,6 +242,7 @@ def save_results(): video_path = os.path.join(save_path, prefix + ".png") image = sample[0] image.save(video_path) + print(f"Saved image to: {video_path}") if ulysses_degree * ring_degree > 1: import torch.distributed as dist diff --git a/examples/z_image_fun/predict_turbo_i2i_tile_2.1_lite.py b/examples/z_image_fun/predict_turbo_i2i_tile_2.1_lite.py index feaf7c1..3814b42 100644 --- a/examples/z_image_fun/predict_turbo_i2i_tile_2.1_lite.py +++ b/examples/z_image_fun/predict_turbo_i2i_tile_2.1_lite.py @@ -171,7 +171,7 @@ if ulysses_degree > 1 or ring_degree > 1: print("Add FSDP DIT") if fsdp_text_encoder: shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=list(text_encoder.model.layers)) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -242,6 +242,7 @@ def save_results(): video_path = os.path.join(save_path, prefix + ".png") image = sample[0] image.save(video_path) + print(f"Saved image to: {video_path}") if ulysses_degree * ring_degree > 1: import torch.distributed as dist diff --git a/examples/z_image_fun/predict_turbo_t2i_control.py b/examples/z_image_fun/predict_turbo_t2i_control.py index 9cd003a..94078d4 100644 --- a/examples/z_image_fun/predict_turbo_t2i_control.py +++ b/examples/z_image_fun/predict_turbo_t2i_control.py @@ -168,7 +168,7 @@ if ulysses_degree > 1 or ring_degree > 1: print("Add FSDP DIT") if fsdp_text_encoder: shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=list(text_encoder.model.layers)) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -227,6 +227,7 @@ def save_results(): video_path = os.path.join(save_path, prefix + ".png") image = sample[0] image.save(video_path) + print(f"Saved image to: {video_path}") if ulysses_degree * ring_degree > 1: import torch.distributed as dist diff --git a/examples/z_image_fun/predict_turbo_t2i_control_2.0.py b/examples/z_image_fun/predict_turbo_t2i_control_2.0.py index 97d9836..9020059 100644 --- a/examples/z_image_fun/predict_turbo_t2i_control_2.0.py +++ b/examples/z_image_fun/predict_turbo_t2i_control_2.0.py @@ -170,7 +170,7 @@ if ulysses_degree > 1 or ring_degree > 1: print("Add FSDP DIT") if fsdp_text_encoder: shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=list(text_encoder.model.layers)) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -241,6 +241,7 @@ def save_results(): video_path = os.path.join(save_path, prefix + ".png") image = sample[0] image.save(video_path) + print(f"Saved image to: {video_path}") if ulysses_degree * ring_degree > 1: import torch.distributed as dist diff --git a/examples/z_image_fun/predict_turbo_t2i_control_2.1.py b/examples/z_image_fun/predict_turbo_t2i_control_2.1.py index ce85113..dbf11c2 100644 --- a/examples/z_image_fun/predict_turbo_t2i_control_2.1.py +++ b/examples/z_image_fun/predict_turbo_t2i_control_2.1.py @@ -178,7 +178,7 @@ if ulysses_degree > 1 or ring_degree > 1: print("Add FSDP DIT") if fsdp_text_encoder: shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=list(text_encoder.model.layers)) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -249,6 +249,7 @@ def save_results(): video_path = os.path.join(save_path, prefix + ".png") image = sample[0] image.save(video_path) + print(f"Saved image to: {video_path}") if ulysses_degree * ring_degree > 1: import torch.distributed as dist diff --git a/examples/z_image_fun/predict_turbo_t2i_control_2.1_lite.py b/examples/z_image_fun/predict_turbo_t2i_control_2.1_lite.py index 087f1c5..4ba2d2b 100644 --- a/examples/z_image_fun/predict_turbo_t2i_control_2.1_lite.py +++ b/examples/z_image_fun/predict_turbo_t2i_control_2.1_lite.py @@ -170,7 +170,7 @@ if ulysses_degree > 1 or ring_degree > 1: print("Add FSDP DIT") if fsdp_text_encoder: shard_fn = partial(shard_model, device_id=device, param_dtype=weight_dtype, module_to_wrapper=list(text_encoder.model.layers)) - text_encoder = shard_fn(text_encoder) + pipeline.text_encoder = shard_fn(pipeline.text_encoder) print("Add FSDP TEXT ENCODER") if compile_dit: @@ -241,6 +241,7 @@ def save_results(): video_path = os.path.join(save_path, prefix + ".png") image = sample[0] image.save(video_path) + print(f"Saved image to: {video_path}") if ulysses_degree * ring_degree > 1: import torch.distributed as dist diff --git a/scripts/qwenimage21_fun/README_TRAIN.md b/scripts/qwenimage21_fun/README_TRAIN.md index 27ab465..3cb3bb8 100644 --- a/scripts/qwenimage21_fun/README_TRAIN.md +++ b/scripts/qwenimage21_fun/README_TRAIN.md @@ -160,19 +160,38 @@ export DATASET_META_NAME="/mnt/data/metadata.json" ### 3.1 Download Pre-trained Model -Point `MODEL_NAME` at a local **Qwen-Image 2.1** checkpoint directory. Its `transformer/` subfolder supplies the -frozen base weights; the control modules are zero-initialized on load. +Place the base weights under `models/Diffusion_Transformer/Qwen-Image-2.1`; its `transformer/` subfolder supplies the +frozen base weights, and the control branch is zero-initialized so training starts from scratch. The ControlNet-Union +weights trained by this project live under `models/Personalized_Model` and can be used directly for inference, or +loaded via `--transformer_path` to continue fine-tuning. + +**ModelScope Download**: ```bash +# Create model directories mkdir -p models/Diffusion_Transformer -# Place your Qwen-Image 2.1 weights here, e.g. -# models/Diffusion_Transformer/Qwen-Image-2.1/{transformer,vae,text_encoder,...} +mkdir -p models/Personalized_Model + +# Download Qwen-Image 2.1 official base weights +modelscope download --model Qwen/Qwen-Image-2.1 --local_dir models/Diffusion_Transformer/Qwen-Image-2.1 + +# Download Qwen-Image 2.1 Control pretrained weights +modelscope download --model PAI/Qwen-Image-2.1-Fun-Controlnet-Union --local_dir models/Personalized_Model/Qwen-Image-2.1-Fun-Controlnet-Union ``` -> **No released 2.1 ControlNet-Union checkpoint.** Unlike Qwen-Image 2512, there is currently no published -> `...-Fun-Controlnet-Union.safetensors` for 2.1, so training starts from scratch with the **zero-initialized** -> control branch. Consequently the launcher leaves `--transformer_path` out; only add it to resume or fine-tune a -> control checkpoint you have already trained (or produced with `scripts/*/extract_control_weights.py`). +**HuggingFace Download**: + +```bash +# Create model directories +mkdir -p models/Diffusion_Transformer +mkdir -p models/Personalized_Model + +# Download Qwen-Image 2.1 official base weights +hf download Qwen/Qwen-Image-2.1 --local-dir models/Diffusion_Transformer/Qwen-Image-2.1 + +# Download Qwen-Image 2.1 Control pretrained weights +hf download alibaba-pai/Qwen-Image-2.1-Fun-Controlnet-Union --local-dir models/Personalized_Model/Qwen-Image-2.1-Fun-Controlnet-Union +``` ### 3.2 Quick Start (DeepSpeed-Zero-2) @@ -224,7 +243,7 @@ accelerate launch --use_deepspeed --deepspeed_config_file config/zero_stage2_con | `--pretrained_model_name_or_path` | Base Qwen-Image 2.1 model (frozen weights) | `models/Diffusion_Transformer/Qwen-Image-2.1` | | `--train_data_dir` / `--train_data_meta` | Dataset root / manifest JSON | `""` / `/path/metadata.json` | | `--trainable_modules` | `"control"` trains only `control_blocks.*` + `control_img_in.*`; base stays frozen | `"control"` | -| `--transformer_path` | **Omit for from-scratch** training; add only to resume/finetune a trained control branch | *(none)* | +| `--transformer_path` | Load trained Control weights to continue fine-tuning; omit for from-scratch training | `models/Personalized_Model/Qwen-Image-2.1-Fun-Controlnet-Union.safetensors` | | `--image_sample_size` | Max training resolution, auto bucketing | `1024` | | `--train_batch_size` / `--gradient_accumulation_steps` | Per-device batch / accumulation | `1` / `1` | | `--learning_rate` | Initial learning rate | `2e-05` | diff --git a/scripts/qwenimage21_fun/README_TRAIN_zh-CN.md b/scripts/qwenimage21_fun/README_TRAIN_zh-CN.md index 42a2977..b85d3a8 100644 --- a/scripts/qwenimage21_fun/README_TRAIN_zh-CN.md +++ b/scripts/qwenimage21_fun/README_TRAIN_zh-CN.md @@ -155,19 +155,37 @@ export DATASET_META_NAME="/mnt/data/metadata.json" ### 3.1 下载预训练模型 -将 `MODEL_NAME` 指向本地的 **Qwen-Image 2.1** checkpoint 目录。其 `transformer/` 子目录提供冻结的基座权重;控制模块在 -载入时零初始化。 +基座权重放在 `models/Diffusion_Transformer/Qwen-Image-2.1`,其 `transformer/` 子目录提供冻结的基座权重;control 分支在载入时 +零初始化,训练从零开始。本项目训练的 ControlNet-Union 权重放在 `models/Personalized_Model`,可直接用于推理,也可通过 +`--transformer_path` 载入后继续微调。 + +**ModelScope 下载**: ```bash +# 创建模型目录 mkdir -p models/Diffusion_Transformer -# 将你的 Qwen-Image 2.1 权重放到这里,例如 -# models/Diffusion_Transformer/Qwen-Image-2.1/{transformer,vae,text_encoder,...} +mkdir -p models/Personalized_Model + +# 下载 Qwen-Image 2.1 官方基座权重 +modelscope download --model Qwen/Qwen-Image-2.1 --local_dir models/Diffusion_Transformer/Qwen-Image-2.1 + +# 下载 Qwen-Image 2.1 Control 预训练权重 +modelscope download --model PAI/Qwen-Image-2.1-Fun-Controlnet-Union --local_dir models/Personalized_Model/Qwen-Image-2.1-Fun-Controlnet-Union ``` -> **没有公开的 2.1 ControlNet-Union checkpoint。** 与 Qwen-Image 2512 不同,2.1 目前并没有发布的 -> `...-Fun-Controlnet-Union.safetensors`,因此训练从零开始,control 分支**零初始化**。所以启动脚本不写 `--transformer_path`; -> 只有在你需要 resume / fine-tune 一个已训练好的 control checkpoint(或你自己用 `scripts/*/extract_control_weights.py` 得到的) -> 时才加上它。 +**HuggingFace 下载**: + +```bash +# 创建模型目录 +mkdir -p models/Diffusion_Transformer +mkdir -p models/Personalized_Model + +# 下载 Qwen-Image 2.1 官方基座权重 +hf download Qwen/Qwen-Image-2.1 --local-dir models/Diffusion_Transformer/Qwen-Image-2.1 + +# 下载 Qwen-Image 2.1 Control 预训练权重 +hf download alibaba-pai/Qwen-Image-2.1-Fun-Controlnet-Union --local-dir models/Personalized_Model/Qwen-Image-2.1-Fun-Controlnet-Union +``` ### 3.2 快速开始(DeepSpeed-Zero-2) @@ -219,7 +237,7 @@ accelerate launch --use_deepspeed --deepspeed_config_file config/zero_stage2_con | `--pretrained_model_name_or_path` | 基座 Qwen-Image 2.1 模型(冻结权重) | `models/Diffusion_Transformer/Qwen-Image-2.1` | | `--train_data_dir` / `--train_data_meta` | 数据根目录 / 清单 JSON | `""` / `/path/metadata.json` | | `--trainable_modules` | `"control"` 只训练 `control_blocks.*` + `control_img_in.*`,基座冻结 | `"control"` | -| `--transformer_path` | **从零训练时省略**;仅在 resume / fine-tune 已训练的 control 分支时加上 | *(无)* | +| `--transformer_path` | 加载已训练好的 Control 权重继续微调;从零训练时省略 | `models/Personalized_Model/Qwen-Image-2.1-Fun-Controlnet-Union.safetensors` | | `--image_sample_size` | 最大训练分辨率,自动 bucket | `1024` | | `--train_batch_size` / `--gradient_accumulation_steps` | 单卡 batch / 梯度累积 | `1` / `1` | | `--learning_rate` | 初始学习率 | `2e-05` |