CoolFace
Modelpublic

bghira/wan2.1-1.3b-anyflow-wip

sourceHugging Faceapache-2.0updated 1mo agoView on Hugging Face
0likes8downloads
Model Card

bghira/wan2.1-1.3b-anyflow-wip

This is a PEFT LoRA derived from Wan-AI/Wan2.1-T2V-1.3B-Diffusers.

The main validation prompt used during training was:

A vibrant green Mustang GT parked in an empty parking lot. The camera slowly pans around the car, showing its sleek design, black hood and black rims in a clean promotional video.

Validation settings

  • —CFG: 1.0
  • —CFG Rescale: 0.0
  • —Steps: 4
  • —Sampler: AnyFlowValidationScheduler (FlowMatchEulerDiscreteScheduler)
  • —Seed: 0
  • —Resolution: 832x480

Note: The validation settings are not necessarily the same as the training settings.

You can find some example images and videos in the following gallery:

<Gallery />

The text encoder was not trained. You may reuse the base model text encoder for inference.

Training settings

  • —Training epochs: 0
  • —Training steps: 6000
  • —Learning rate: 6e-05
  • —Learning rate schedule: constantwithwarmup
  • —Warmup steps: 1000
  • —Max grad norm: 1.0
  • —Effective batch size: 8
  • —Micro-batch size: 1
  • —Gradient accumulation steps: 1
  • —Number of GPUs: 8
  • —Gradient checkpointing: False
  • —Prediction type: flow_matching (extra parameters=['shift=5.0'])
  • —Optimizer: torch-adamw (config=weight_decay=0.0,eps=1e-8)
  • —Trainable parameter precision: Pure BF16
  • —Base model precision: no_change
  • —Caption dropout probability: 0.1%
  • —LoRA Rank: 256
  • —LoRA Alpha: 256.0
  • —LoRA Dropout: 0.0
  • —LoRA initialisation style: default
  • —LoRA mode: Standard

Datasets

wan21-anyflow-openvid-81f-832x480

  • —Repeats: 0
  • —Total number of videos: 8192
  • —Total number of aspect buckets: 1
  • —Target frame count: 81
  • —FPS: 16
  • —Used for regularisation data: No

Inference

python
import torch
from diffusers import DiffusionPipeline

model_id = 'Wan-AI/Wan2.1-T2V-1.3B-Diffusers'
adapter_id = 'bghira/wan2.1-1.3b-anyflow-wip'
pipeline = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) # loading directly in bf16
pipeline.load_lora_weights(adapter_id)

prompt = "A vibrant green Mustang GT parked in an empty parking lot. The camera slowly pans around the car, showing its sleek design, black hood and black rims in a clean promotional video."
negative_prompt = '色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走'

## Optional: quantise the model to save on vram.
## Note: The model was not quantised during training, so it is not necessary to quantise it during inference time.
#from optimum.quanto import quantize, freeze, qint8
#quantize(pipeline.transformer, weights=qint8)
#freeze(pipeline.transformer)
    
pipeline.to('cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu') # the pipeline is already in its target precision level
model_output = pipeline(
    prompt=prompt,
    negative_prompt=negative_prompt,
    num_inference_steps=4,
    generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(1),
    width=832,
    height=480,
    guidance_scale=1.0,
).images[0]

from diffusers.utils.export_utils import export_to_gif
export_to_gif(model_output, "output.gif", fps=16)

Exponential Moving Average (EMA)

SimpleTuner generates a safetensors variant of the EMA weights and a pt file.

The safetensors file is intended to be used for inference, and the pt file is for continuing finetuning.

The EMA model may provide a more well-rounded result, but typically will feel undertrained compared to the full model as it is a running decayed average of the model weights.