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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
base_model:
|
| 6 |
+
- Wan-AI/Wan2.1-I2V-14B-480P
|
| 7 |
+
- Wan-AI/Wan2.1-I2V-14B-480P-Diffusers
|
| 8 |
+
pipeline_tag: image-to-video
|
| 9 |
+
tags:
|
| 10 |
+
- text-to-image
|
| 11 |
+
- lora
|
| 12 |
+
- diffusers
|
| 13 |
+
- template:diffusion-lora
|
| 14 |
+
widget:
|
| 15 |
+
- text: >-
|
| 16 |
+
In the video, a miniature dog is presented. The dog is held in a person's
|
| 17 |
+
hands. The person then presses on the dog, causing a sq41sh squish effect.
|
| 18 |
+
The person keeps pressing down on the dog, further showing the sq41sh squish
|
| 19 |
+
effect.
|
| 20 |
+
output:
|
| 21 |
+
url: example_videos/dog_squish.mp4
|
| 22 |
+
- text: >-
|
| 23 |
+
In the video, a miniature tank is presented. The tank is held in a person's
|
| 24 |
+
hands. The person then presses on the tank, causing a sq41sh squish effect.
|
| 25 |
+
The person keeps pressing down on the tank, further showing the sq41sh
|
| 26 |
+
squish effect.
|
| 27 |
+
output:
|
| 28 |
+
url: example_videos/tank_squish.mp4
|
| 29 |
+
- text: >-
|
| 30 |
+
In the video, a miniature balloon is presented. The balloon is held in a
|
| 31 |
+
person's hands. The person then presses on the balloon, causing a sq41sh
|
| 32 |
+
squish effect. The person keeps pressing down on the balloon, further
|
| 33 |
+
showing the sq41sh squish effect.
|
| 34 |
+
output:
|
| 35 |
+
url: example_videos/balloon_squish.mp4
|
| 36 |
+
- text: >-
|
| 37 |
+
In the video, a miniature rodent is presented. The rodent is held in a
|
| 38 |
+
person's hands. The person then presses on the rodent, causing a sq41sh
|
| 39 |
+
squish effect. The person keeps pressing down on the rodent, further showing
|
| 40 |
+
the sq41sh squish effect.
|
| 41 |
+
output:
|
| 42 |
+
url: example_videos/rodent_squish.mp4
|
| 43 |
+
- text: >-
|
| 44 |
+
In the video, a miniature person is presented. The person is held in a
|
| 45 |
+
person's hands. The person then presses on the person, causing a sq41sh
|
| 46 |
+
squish effect. The person keeps pressing down on the person, further showing
|
| 47 |
+
the sq41sh squish effect.
|
| 48 |
+
output:
|
| 49 |
+
url: example_videos/person_squish.mp4
|
| 50 |
+
---
|
| 51 |
+
<div style="background-color: #f8f9fa; padding: 20px; border-radius: 10px; margin-bottom: 20px;">
|
| 52 |
+
<h1 style="color: #24292e; margin-top: 0;">Squish Effect LoRA for Wan2.1 14B I2V 480p</h1>
|
| 53 |
+
|
| 54 |
+
<div style="background-color: white; padding: 15px; border-radius: 8px; margin: 15px 0; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
|
| 55 |
+
<h2 style="color: #24292e; margin-top: 0;">Overview</h2>
|
| 56 |
+
<p>This LoRA is trained on the Wan2.1 14B I2V 480p model and allows you to squish any object in an image. The effect works on a wide variety of objects, from animals to vehicles to people!</p>
|
| 57 |
+
</div>
|
| 58 |
+
|
| 59 |
+
<div style="background-color: white; padding: 15px; border-radius: 8px; margin: 15px 0; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
|
| 60 |
+
<h2 style="color: #24292e; margin-top: 0;">Features</h2>
|
| 61 |
+
<ul style="margin-bottom: 0;">
|
| 62 |
+
<li>Transform any image into a video of it being squished</li>
|
| 63 |
+
<li>Trained on the Wan2.1 14B 480p I2V base model</li>
|
| 64 |
+
<li>Consistent results across different object types</li>
|
| 65 |
+
<li>Simple prompt structure that's easy to adapt</li>
|
| 66 |
+
</ul>
|
| 67 |
+
</div>
|
| 68 |
+
|
| 69 |
+
<div style="background-color: white; padding: 15px; border-radius: 8px; margin: 15px 0; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
|
| 70 |
+
<h2 style="color: #24292e; margin-top: 0;">Community</h2>
|
| 71 |
+
<ul style="margin-bottom: 0;">
|
| 72 |
+
<li>
|
| 73 |
+
Generate videos with 100+ Camera Control and VFX LoRAs on the
|
| 74 |
+
<a href="https://app.remade.ai/canvas/create" style="color: #0366d6; text-decoration: none;">Remade Canvas</a>.
|
| 75 |
+
</li>
|
| 76 |
+
<li>
|
| 77 |
+
<b>Discord:</b>
|
| 78 |
+
<a href="https://remade.ai/join-discord?utm_source=Huggingface&utm_medium=Social&utm_campaign=model_release&utm_content=crash_zoom_out" style="color: #0366d6; text-decoration: none;">
|
| 79 |
+
Join our community
|
| 80 |
+
</a> to generate videos with this LoRA for free
|
| 81 |
+
</li>
|
| 82 |
+
</ul>
|
| 83 |
+
</div>
|
| 84 |
+
|
| 85 |
+
<Gallery />
|
| 86 |
+
|
| 87 |
+
# Model File and Inference Workflow
|
| 88 |
+
|
| 89 |
+
## 📥 Download Links:
|
| 90 |
+
|
| 91 |
+
- [squish_18.safetensors](./squish_18.safetensors) - LoRA Model File
|
| 92 |
+
- [wan_img2video_lora_workflow.json](./workflow/wan_img2video_lora_workflow.json) - Wan I2V with LoRA Workflow for ComfyUI
|
| 93 |
+
|
| 94 |
+
## Using with Diffusers
|
| 95 |
+
```py
|
| 96 |
+
pip install git+https://github.com/huggingface/diffusers.git
|
| 97 |
+
```
|
| 98 |
+
|
| 99 |
+
```py
|
| 100 |
+
import torch
|
| 101 |
+
from diffusers.utils import export_to_video, load_image
|
| 102 |
+
from diffusers import AutoencoderKLWan, WanImageToVideoPipeline
|
| 103 |
+
from transformers import CLIPVisionModel
|
| 104 |
+
import numpy as np
|
| 105 |
+
|
| 106 |
+
model_id = "Wan-AI/Wan2.1-I2V-14B-480P-Diffusers"
|
| 107 |
+
image_encoder = CLIPVisionModel.from_pretrained(model_id, subfolder="image_encoder", torch_dtype=torch.float32)
|
| 108 |
+
vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", torch_dtype=torch.float32)
|
| 109 |
+
pipe = WanImageToVideoPipeline.from_pretrained(model_id, vae=vae, image_encoder=image_encoder, torch_dtype=torch.bfloat16)
|
| 110 |
+
pipe.to("cuda")
|
| 111 |
+
|
| 112 |
+
pipe.load_lora_weights("Remade/Squish")
|
| 113 |
+
|
| 114 |
+
pipe.enable_model_cpu_offload() #for low-vram environments
|
| 115 |
+
|
| 116 |
+
prompt = "In the video, a miniature cat toy is presented. The cat toy is held in a person's hands. The person then presses on the cat toy, causing a sq41sh squish effect. The person keeps pressing down on the cat toy, further showing the sq41sh squish effect."
|
| 117 |
+
|
| 118 |
+
image = load_image("https://huggingface.co/datasets/diffusers/cat_toy_example/resolve/main/1.jpeg")
|
| 119 |
+
|
| 120 |
+
max_area = 480 * 832
|
| 121 |
+
aspect_ratio = image.height / image.width
|
| 122 |
+
mod_value = pipe.vae_scale_factor_spatial * pipe.transformer.config.patch_size[1]
|
| 123 |
+
height = round(np.sqrt(max_area * aspect_ratio)) // mod_value * mod_value
|
| 124 |
+
width = round(np.sqrt(max_area / aspect_ratio)) // mod_value * mod_value
|
| 125 |
+
image = image.resize((width, height))
|
| 126 |
+
|
| 127 |
+
output = pipe(
|
| 128 |
+
image=image,
|
| 129 |
+
prompt=prompt,
|
| 130 |
+
height=height,
|
| 131 |
+
width=width,
|
| 132 |
+
num_frames=81,
|
| 133 |
+
guidance_scale=5.0,
|
| 134 |
+
num_inference_steps=28
|
| 135 |
+
).frames[0]
|
| 136 |
+
export_to_video(output, "output.mp4", fps=16)
|
| 137 |
+
```
|
| 138 |
+
|
| 139 |
+
---
|
| 140 |
+
<div style="background-color: #f8f9fa; padding: 20px; border-radius: 10px; margin-bottom: 20px;">
|
| 141 |
+
<div style="background-color: white; padding: 15px; border-radius: 8px; margin: 15px 0; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
|
| 142 |
+
<h2 style="color: #24292e; margin-top: 0;">Recommended Settings</h2>
|
| 143 |
+
<ul style="margin-bottom: 0;">
|
| 144 |
+
<li><b>LoRA Strength:</b> 1.0</li>
|
| 145 |
+
<li><b>Embedded Guidance Scale:</b> 6.0</li>
|
| 146 |
+
<li><b>Flow Shift:</b> 5.0</li>
|
| 147 |
+
</ul>
|
| 148 |
+
</div>
|
| 149 |
+
|
| 150 |
+
<div style="background-color: white; padding: 15px; border-radius: 8px; margin: 15px 0; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
|
| 151 |
+
<h2 style="color: #24292e; margin-top: 0;">Trigger Words</h2>
|
| 152 |
+
<p>The key trigger phrase is: <code style="background-color: #f0f0f0; padding: 3px 6px; border-radius: 4px;">sq41sh squish effect</code></p>
|
| 153 |
+
</div>
|
| 154 |
+
|
| 155 |
+
<div style="background-color: white; padding: 15px; border-radius: 8px; margin: 15px 0; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
|
| 156 |
+
<h2 style="color: #24292e; margin-top: 0;">Prompt Template</h2>
|
| 157 |
+
<p>For best results, use this prompt structure:</p>
|
| 158 |
+
<div style="background-color: #f0f0f0; padding: 12px; border-radius: 6px; margin: 10px 0;">
|
| 159 |
+
<i>In the video, a miniature [object] is presented. The [object] is held in a person's hands. The person then presses on the [object], causing a sq41sh squish effect. The person keeps pressing down on the [object], further showing the sq41sh squish effect.</i>
|
| 160 |
+
</div>
|
| 161 |
+
<p>Simply replace <code style="background-color: #f0f0f0; padding: 3px 6px; border-radius: 4px;">[object]</code> with whatever you want to see squished!</p>
|
| 162 |
+
</div>
|
| 163 |
+
|
| 164 |
+
<div style="background-color: white; padding: 15px; border-radius: 8px; margin: 15px 0; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
|
| 165 |
+
<h2 style="color: #24292e; margin-top: 0;">ComfyUI Workflow</h2>
|
| 166 |
+
<p>This LoRA works with a modified version of <a href="https://github.com/kijai/ComfyUI-WanVideoWrapper/blob/main/example_workflows/wanvideo_480p_I2V_example_02.json" style="color: #0366d6; text-decoration: none;">Kijai's Wan Video Wrapper workflow</a>. The main modification is adding a Wan LoRA node connected to the base model.</p>
|
| 167 |
+
<img src="./workflow/workflow_screenshot.png" style="width: 100%; border-radius: 8px; margin: 15px 0; box-shadow: 0 4px 8px rgba(0,0,0,0.1);">
|
| 168 |
+
<p>See the Downloads section above for the modified workflow.</p>
|
| 169 |
+
</div>
|
| 170 |
+
</div>
|
| 171 |
+
|
| 172 |
+
<div style="background-color: #f8f9fa; padding: 20px; border-radius: 10px; margin-bottom: 20px;">
|
| 173 |
+
<div style="background-color: white; padding: 15px; border-radius: 8px; margin: 15px 0; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
|
| 174 |
+
<h2 style="color: #24292e; margin-top: 0;">Model Information</h2>
|
| 175 |
+
<p>The model weights are available in Safetensors format. See the Downloads section above.</p>
|
| 176 |
+
</div>
|
| 177 |
+
|
| 178 |
+
<div style="background-color: white; padding: 15px; border-radius: 8px; margin: 15px 0; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
|
| 179 |
+
<h2 style="color: #24292e; margin-top: 0;">Training Details</h2>
|
| 180 |
+
<ul style="margin-bottom: 0;">
|
| 181 |
+
<li><b>Base Model:</b> Wan2.1 14B I2V 480p</li>
|
| 182 |
+
<li><b>Training Data:</b> 1.5 minutes of video (20 short clips of things being squished)</li>
|
| 183 |
+
<li><b>Epochs:</b> 18</li>
|
| 184 |
+
</ul>
|
| 185 |
+
</div>
|
| 186 |
+
|
| 187 |
+
<div style="background-color: white; padding: 15px; border-radius: 8px; margin: 15px 0; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
|
| 188 |
+
<h2 style="color: #24292e; margin-top: 0;">Additional Information</h2>
|
| 189 |
+
<p>Training was done using <a href="https://github.com/tdrussell/diffusion-pipe" style="color: #0366d6; text-decoration: none;">Diffusion Pipe for Training</a></p>
|
| 190 |
+
</div>
|
| 191 |
+
|
| 192 |
+
<div style="background-color: white; padding: 15px; border-radius: 8px; margin: 15px 0; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
|
| 193 |
+
<h2 style="color: #24292e; margin-top: 0;">Acknowledgments</h2>
|
| 194 |
+
<p style="margin-bottom: 0;">Special thanks to Kijai for the ComfyUI Wan Video Wrapper and tdrussell for the training scripts!</p>
|
| 195 |
+
</div>
|
| 196 |
+
</div>
|