Upload folder using huggingface_hub
Browse filesFiles changed (3)
- README.mdAdded+115
- config.yamlAdded+62
- wan2.1-14b-mkvideo-lora.safetensorsAdded+3
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115---license: apache-2.0language:- en- zhtags:- image-to-video- lora- replicate- text-to-video- video- video-generationbase_model: "Wan-AI/Wan2.1-T2V-14B-Diffusers"pipeline_tag: text-to-video# widget:# - text: >-# prompt# output:# url: https://...instance_prompt: MKVideo---
# Mkred
<Gallery />
## About this LoRA
This is a [LoRA](https://replicate.com/docs/guides/working-with-loras) for the Wan2.1 14b video generation model.
It can be used with diffusers or ComfyUI, and can be loaded against both the text-to-video and image-to-video Wan2.1 models.
It was trained on [Replicate](https://replicate.com/) using AI toolkit: https://replicate.com/ostris/wan-lora-trainer/train
## Trigger words
You should use `MKVideo` to trigger the video generation.
## Use this LoRA
Replicate has a collection of Wan2.1 models that are optimised for speed and cost. They can also be used with this LoRA:
- https://replicate.com/collections/wan-video- https://replicate.com/fofr/wan2.1-with-lora
### Run this LoRA with an API using Replicate
```pyimport replicate
input = { "prompt": "MKVideo", "lora_url": "https://huggingface.co/hellomrsheel/MKRed/resolve/main/wan2.1-14b-mkvideo-lora.safetensors"}
output = replicate.run( "fofr/wan2.1-with-lora:f83b84064136a38415a3aff66c326f94c66859b8ad7a2cb432e2822774f07b08", model="14b", input=input)for index, item in enumerate(output): with open(f"output_{index}.mp4", "wb") as file: file.write(item.read())```
### Using with Diffusers
```pypip install git+https://github.com/huggingface/diffusers.git```
```pyimport torchfrom diffusers.utils import export_to_videofrom diffusers import AutoencoderKLWan, WanPipelinefrom diffusers.schedulers.scheduling_unipc_multistep import UniPCMultistepScheduler
model_id = "Wan-AI/Wan2.1-T2V-14B-Diffusers"vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", torch_dtype=torch.float32)pipe = WanPipeline.from_pretrained(model_id, vae=vae, torch_dtype=torch.bfloat16)flow_shift = 3.0 # 5.0 for 720P, 3.0 for 480Ppipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config, flow_shift=flow_shift)pipe.to("cuda")
pipe.load_lora_weights("hellomrsheel/MKRed")
pipe.enable_model_cpu_offload() #for low-vram environments
prompt = "MKVideo"negative_prompt = "Bright tones, overexposed, static, blurred details, subtitles, style, works, paintings, images, static, overall gray, worst quality, low quality, JPEG compression residue, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn faces, deformed, disfigured, misshapen limbs, fused fingers, still picture, messy background, three legs, many people in the background, walking backwards"
output = pipe( prompt=prompt, negative_prompt=negative_prompt, height=480, width=832, num_frames=81, guidance_scale=5.0,).frames[0]export_to_video(output, "output.mp4", fps=16)```
## Training details
- Steps: 2500- Learning rate: 0.0001- LoRA rank: 32
## Contribute your own examples
You can use the [community tab](https://huggingface.co/hellomrsheel/MKRed/discussions) to add videos that show off what you’ve made with this LoRA.1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162job: custom_jobconfig: name: wan_train_replicate process: - type: custom_sd_trainer training_folder: output device: cuda:0 trigger_word: MKVideo network: type: lora linear: 32 linear_alpha: 32 save: dtype: float16 save_every: 2501 max_step_saves_to_keep: 1 datasets: - folder_path: input_images caption_ext: txt caption_dropout_rate: 0.05 shuffle_tokens: false cache_latents_to_disk: false cache_latents: true resolution: - 632 train: batch_size: 1 steps: 2500 gradient_accumulation_steps: 1 train_unet: true train_text_encoder: false gradient_checkpointing: false noise_scheduler: flowmatch timestep_type: sigmoid optimizer: adamw8bit optimizer_params: weight_decay: 0.0001 lr: 0.0001 ema_config: use_ema: true ema_decay: 0.99 dtype: bf16 model: name_or_path: Wan-AI/Wan2.1-T2V-14B-Diffusers quantize: false arch: wan21 sample: sampler: flowmatch sample_every: 2501 width: 832 height: 480 num_frames: 33 fps: 16 prompts: [] neg: '' seed: 42 walk_seed: true guidance_scale: 5 sample_steps: 30meta: name: wan_train_replicate version: '1.0'123version https://git-lfs.github.com/spec/v1oid sha256:44b5ff332d5011a4d3b1e378518eec190e580c6243a73e989e6d384422e193fcsize 306807632README.mdAdded+115
config.yamlAdded+62
wan2.1-14b-mkvideo-lora.safetensorsAdded+3