Upload folder using huggingface_hub
Browse files- .gitattributes +3 -0
- README.md +82 -0
- README_from_modelscope.md +96 -0
- configuration.json +1 -0
- model.safetensors +3 -0
- video_merged_1.mp4 +3 -0
- video_merged_2.mp4 +3 -0
- video_merged_3.mp4 +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
video_merged_1.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
video_merged_2.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
video_merged_3.mp4 filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
---
|
| 4 |
+
# Wanxiao 2.1-1.3B-LoRA-Speed-Control-v1
|
| 5 |
+
|
| 6 |
+
## Model Introduction
|
| 7 |
+
|
| 8 |
+
This model is trained based on the [Wanxiao 2.1-1.3B](https://www.modelscope.cn/models/Wan-AI/Wan2.1-T2V-1.3B) model and the [DiffSynth-Studio](https://github.com/modelscope/DiffSynth-Studio) framework. Using a structure similar to T2I-Adapter, an additional motion speed encoder is introduced to incorporate the *motion bucket id* for controlling the magnitude of motion. The encoder adopts a RoPE encoding + MLP architecture. The *motion bucket id* is calculated based on the quantiles of the standard deviation of latents along the temporal axis, mapped to a control range of 0–100.
|
| 9 |
+
|
| 10 |
+
* **motion bucket id = 1**: Slower motion, enhanced visual quality
|
| 11 |
+
* **motion bucket id = 100**: Faster motion, reduced visual quality
|
| 12 |
+
|
| 13 |
+
## Model Performance
|
| 14 |
+
|
| 15 |
+
**Prompt**: Documentary photography style, an energetic puppy rapidly running on lush green grass. The puppy has brownish-yellow fur, upright ears, and an expression that is focused and joyful. Sunlight shines on its body, making its fur appear exceptionally soft and shiny. The background features an open grassland with occasional wildflowers, and in the distance, a faint view of blue sky and scattered clouds. Strong perspective emphasizes the dynamic movement of the running puppy and the vitality of the surrounding grass. Medium shot with a side-moving viewpoint.
|
| 16 |
+
|
| 17 |
+
**Negative Prompt**: Vivid colors, overexposure, static, blurry details, subtitles, style, artwork, painting, stillness, overall grayish tone, worst quality, low quality, JPEG compression artifacts, ugly, defective, extra fingers, poorly drawn hands, poorly drawn face, deformed limbs, fused fingers, motionless frames, cluttered background, three legs, crowded background people, walking backwards.
|
| 18 |
+
|
| 19 |
+
**Example 1** (seed=1, left: motion bucket id=1, right: motion bucket id=100)
|
| 20 |
+
|
| 21 |
+
<div align="center"><video width="80%" controls><source src="video_merged_1.mp4" type="video/mp4">Your browser does not support the video tag.</video></div>
|
| 22 |
+
|
| 23 |
+
**Example 2** (seed=2, left: motion bucket id=1, right: motion bucket id=100)
|
| 24 |
+
|
| 25 |
+
<div align="center"><video width="80%" controls><source src="video_merged_2.mp4" type="video/mp4">Your browser does not support the video tag.</video></div>
|
| 26 |
+
|
| 27 |
+
**Example 3** (seed=3, left: motion bucket id=1, right: motion bucket id=100)
|
| 28 |
+
|
| 29 |
+
<div align="center"><video width="80%" controls><source src="video_merged_2.mp4" type="video/mp4">Your browser does not support the video tag.</video></div>
|
| 30 |
+
|
| 31 |
+
## Usage Instructions
|
| 32 |
+
|
| 33 |
+
This model is trained using the [DiffSynth-Studio](https://github.com/modelscope/DiffSynth-Studio) framework. Please install it first:
|
| 34 |
+
|
| 35 |
+
```
|
| 36 |
+
pip install diffsynth
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
```python
|
| 40 |
+
import torch
|
| 41 |
+
from diffsynth import ModelManager, WanVideoPipeline, save_video, VideoData
|
| 42 |
+
from modelscope import snapshot_download
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
# Download models
|
| 46 |
+
snapshot_download("Wan-AI/Wan2.1-T2V-1.3B", local_dir="models/Wan-AI/Wan2.1-T2V-1.3B")
|
| 47 |
+
snapshot_download("DiffSynth-Studio/Wan2.1-1.3b-speedcontrol-v1", local_dir="models/DiffSynth-Studio/Wan2.1-1.3b-speedcontrol-v1")
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
# Load models
|
| 51 |
+
model_manager = ModelManager(device="cpu")
|
| 52 |
+
model_manager.load_models(
|
| 53 |
+
[
|
| 54 |
+
"models/Wan-AI/Wan2.1-T2V-1.3B/diffusion_pytorch_model.safetensors",
|
| 55 |
+
"models/Wan-AI/Wan2.1-T2V-1.3B/models_t5_umt5-xxl-enc-bf16.pth",
|
| 56 |
+
"models/Wan-AI/Wan2.1-T2V-1.3B/Wan2.1_VAE.pth",
|
| 57 |
+
"models/DiffSynth-Studio/Wan2.1-1.3b-speedcontrol-v1/model.safetensors",
|
| 58 |
+
],
|
| 59 |
+
torch_dtype=torch.bfloat16, # You can set `torch_dtype=torch.float8_e4m3fn` to enable FP8 quantization.
|
| 60 |
+
)
|
| 61 |
+
pipe = WanVideoPipeline.from_model_manager(model_manager, torch_dtype=torch.bfloat16, device="cuda")
|
| 62 |
+
pipe.enable_vram_management(num_persistent_param_in_dit=None)
|
| 63 |
+
|
| 64 |
+
# Text-to-video
|
| 65 |
+
video = pipe(
|
| 66 |
+
prompt="Documentary photography style scene: a lively little dog rapidly running on a green grassy field. The dog has a brownish-yellow coat, upright ears, and an expression of focus and joy. Sunlight shines on its body, making its fur appear exceptionally soft and shiny. The background is an open grassland, occasionally dotted with a few wildflowers, with a faint view of blue sky and some white clouds in the distance. Strong sense of perspective captures the dynamic motion of the running dog and the vitality of the surrounding grass. Medium shot with a side-moving viewpoint.",
|
| 67 |
+
negative_prompt="vivid colors, overexposed, static, blurry details, subtitles, style, artwork, painting, frame, still, overall grayish, worst quality, low quality, JPEG compression artifacts, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn face, deformed, disfigured, malformed limbs, fused fingers, motionless frame, cluttered background, three legs, crowded background, walking backwards",
|
| 68 |
+
num_inference_steps=50,
|
| 69 |
+
seed=1, tiled=True,
|
| 70 |
+
motion_bucket_id=0
|
| 71 |
+
)
|
| 72 |
+
save_video(video, "video_slow.mp4", fps=15, quality=5)
|
| 73 |
+
|
| 74 |
+
video = pipe(
|
| 75 |
+
prompt="Documentary photography style scene: a lively little dog rapidly running on a green grassy field. The dog has a brownish-yellow coat, upright ears, and an expression of focus and joy. Sunlight shines on its body, making its fur appear exceptionally soft and shiny. The background is an open grassland, occasionally dotted with a few wildflowers, with a faint view of blue sky and some white clouds in the distance. Strong sense of perspective captures the dynamic motion of the running dog and the vitality of the surrounding grass. Medium shot with a side-moving viewpoint.",
|
| 76 |
+
negative_prompt="vivid colors, overexposed, static, blurry details, subtitles, style, artwork, painting, frame, still, overall grayish, worst quality, low quality, JPEG compression artifacts, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn face, deformed, disfigured, malformed limbs, fused fingers, motionless frame, cluttered background, three legs, crowded background, walking backwards",
|
| 77 |
+
num_inference_steps=50,
|
| 78 |
+
seed=1, tiled=True,
|
| 79 |
+
motion_bucket_id=100
|
| 80 |
+
)
|
| 81 |
+
save_video(video, "video_fast.mp4", fps=15, quality=5)
|
| 82 |
+
```
|
README_from_modelscope.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: MusePublic/wan2.1-1.3b@v1
|
| 3 |
+
frameworks:
|
| 4 |
+
- Pytorch
|
| 5 |
+
license: Apache License 2.0
|
| 6 |
+
tags:
|
| 7 |
+
- LoRA
|
| 8 |
+
- text2video generation
|
| 9 |
+
tasks:
|
| 10 |
+
- text-to-video-synthesis
|
| 11 |
+
|
| 12 |
+
trigger_words:
|
| 13 |
+
- "low speed"
|
| 14 |
+
|
| 15 |
+
vision_foundation: WAN_VIDEO_2_1_T2V_1_3_B
|
| 16 |
+
---
|
| 17 |
+
|
| 18 |
+
# 通义万相2.1-1.3B-LoRA-速度控制-v1
|
| 19 |
+
|
| 20 |
+
## 模型介绍
|
| 21 |
+
|
| 22 |
+
本模是基于模型[通义万相2.1-1.3B](https://www.modelscope.cn/models/Wan-AI/Wan2.1-T2V-1.3B)和框架 [DiffSynth-Studio](https://github.com/modelscope/DiffSynth-Studio) 训练,以类似于T2I-Adapter的结构,额外接入了一个动作速度编码器来引入motion bucket id,用于控制运动幅度。本编码器的结构是RoPE编码 + MLP,motion bucket id 按照 latents 在时间轴上的标准差的分位数计算,映射到 0~100 的控制范围。
|
| 23 |
+
|
| 24 |
+
* **motion bucket id = 1**: 运动速度变慢,画质增强
|
| 25 |
+
* **motion bucket id = 100**: 运动速度变快,画质降低
|
| 26 |
+
|
| 27 |
+
## 模型效果
|
| 28 |
+
|
| 29 |
+
提示词:纪实摄影风格画面,一只活泼的小狗在绿茵茵的草地上迅速奔跑。小狗毛色棕黄,两只耳朵立起,神情专注而欢快。阳光洒在它身上,使得毛发看上去格外柔软而闪亮。背景是一片开阔的草地,偶尔点缀着几朵野花,远处隐约可见蓝天和几片白云。透视感鲜明,捕捉小狗奔跑时的动感和四周草地的生机。中景侧面移动视角。
|
| 30 |
+
|
| 31 |
+
负面提示词:色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走
|
| 32 |
+
|
| 33 |
+
案例1(seed=1, 左边motion bucket id=1, 右边motion bucket id=100)
|
| 34 |
+
|
| 35 |
+
<div align="center"><video width="80%" controls><source src="video_merged_1.mp4" type="video/mp4">Your browser does not support the video tag.</video></div>
|
| 36 |
+
|
| 37 |
+
案例2(seed=2, 左边motion bucket id=1, 右边motion bucket id=100)
|
| 38 |
+
|
| 39 |
+
<div align="center"><video width="80%" controls><source src="video_merged_2.mp4" type="video/mp4">Your browser does not support the video tag.</video></div>
|
| 40 |
+
|
| 41 |
+
案例3(seed=3, 左边motion bucket id=1, 右边motion bucket id=100)
|
| 42 |
+
|
| 43 |
+
<div align="center"><video width="80%" controls><source src="video_merged_2.mp4" type="video/mp4">Your browser does not support the video tag.</video></div>
|
| 44 |
+
|
| 45 |
+
## 使用说明
|
| 46 |
+
|
| 47 |
+
本模型基于框架 [DiffSynth-Studio](https://github.com/modelscope/DiffSynth-Studio) 训练,请先安装
|
| 48 |
+
|
| 49 |
+
```
|
| 50 |
+
pip install diffsynth
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
```python
|
| 55 |
+
import torch
|
| 56 |
+
from diffsynth import ModelManager, WanVideoPipeline, save_video, VideoData
|
| 57 |
+
from modelscope import snapshot_download
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
# Download models
|
| 61 |
+
snapshot_download("Wan-AI/Wan2.1-T2V-1.3B", local_dir="models/Wan-AI/Wan2.1-T2V-1.3B")
|
| 62 |
+
snapshot_download("DiffSynth-Studio/Wan2.1-1.3b-speedcontrol-v1", local_dir="models/DiffSynth-Studio/Wan2.1-1.3b-speedcontrol-v1")
|
| 63 |
+
|
| 64 |
+
# Load models
|
| 65 |
+
model_manager = ModelManager(device="cpu")
|
| 66 |
+
model_manager.load_models(
|
| 67 |
+
[
|
| 68 |
+
"models/Wan-AI/Wan2.1-T2V-1.3B/diffusion_pytorch_model.safetensors",
|
| 69 |
+
"models/Wan-AI/Wan2.1-T2V-1.3B/models_t5_umt5-xxl-enc-bf16.pth",
|
| 70 |
+
"models/Wan-AI/Wan2.1-T2V-1.3B/Wan2.1_VAE.pth",
|
| 71 |
+
"models/DiffSynth-Studio/Wan2.1-1.3b-speedcontrol-v1/model.safetensors",
|
| 72 |
+
],
|
| 73 |
+
torch_dtype=torch.bfloat16, # You can set `torch_dtype=torch.float8_e4m3fn` to enable FP8 quantization.
|
| 74 |
+
)
|
| 75 |
+
pipe = WanVideoPipeline.from_model_manager(model_manager, torch_dtype=torch.bfloat16, device="cuda")
|
| 76 |
+
pipe.enable_vram_management(num_persistent_param_in_dit=None)
|
| 77 |
+
|
| 78 |
+
# Text-to-video
|
| 79 |
+
video = pipe(
|
| 80 |
+
prompt="纪实摄影风格画面,一只活泼的小狗在绿茵茵的草地上迅速奔跑。小狗毛色棕黄,两只耳朵立起,神情专注而欢快。阳光洒在它身上,使得毛发看上去格外柔软而闪亮。背景是一片开阔的草地,偶尔点缀着几朵野花,远处隐约可见蓝天和几片白云。透视感鲜明,捕捉小狗奔跑时的动感和四周草地的生机。中景侧面移动视角。",
|
| 81 |
+
negative_prompt="色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走",
|
| 82 |
+
num_inference_steps=50,
|
| 83 |
+
seed=1, tiled=True,
|
| 84 |
+
motion_bucket_id=0
|
| 85 |
+
)
|
| 86 |
+
save_video(video, "video_slow.mp4", fps=15, quality=5)
|
| 87 |
+
|
| 88 |
+
video = pipe(
|
| 89 |
+
prompt="纪实摄影风格画面,一只活泼的小狗在绿茵茵的草地上迅速奔跑。小狗毛色棕黄,两只耳朵立起,神情专注而欢快。阳光洒在它身上,使得毛发看上去格外柔软而闪亮。背景是一片开阔的草地,偶尔点���着几朵野花,远处隐约可见蓝天和几片白云。透视感鲜明,捕捉小狗奔跑时的动感和四周草地的生机。中景侧面移动视角。",
|
| 90 |
+
negative_prompt="色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走",
|
| 91 |
+
num_inference_steps=50,
|
| 92 |
+
seed=1, tiled=True,
|
| 93 |
+
motion_bucket_id=100
|
| 94 |
+
)
|
| 95 |
+
save_video(video, "video_fast.mp4", fps=15, quality=5)
|
| 96 |
+
```
|
configuration.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"framework":"Pytorch","task":"text-to-video-synthesis"}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:44f06a18b0ea2fea0be49641d7a7db23491028208677f6a349ebff8ed93eadd7
|
| 3 |
+
size 33841656
|
video_merged_1.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b7417ec6b1192a226a8a03f8a8696773057d11f4a17e7a9fd9b63961ceba8da4
|
| 3 |
+
size 1481100
|
video_merged_2.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ab9926a8e4a012bf6edfa2a2c549eeb43fb80ab0ee043d45f8aeb385591b1ee0
|
| 3 |
+
size 1239117
|
video_merged_3.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b005d6e99d07e1733b9c5b4e6799f8b4b98b22cb4e6f9931126c357a4b70833b
|
| 3 |
+
size 1286867
|