Instructions to use Remade-AI/Cakeify with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Remade-AI/Cakeify with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image, export_to_video # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("Wan-AI/Wan2.1-I2V-14B-480P,Wan-AI/Wan2.1-I2V-14B-480P-Diffusers", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("Remade-AI/Cakeify") prompt = "The video opens on a puppy. A knife, held by a hand, is coming into frame and hovering over the puppy. The knife then begins cutting into the puppy to c4k3 cakeify it. As the knife slices the puppy open, the inside of the puppy is revealed to be cake with chocolate layers. The knife cuts through and the contents of the puppy are revealed." input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/guitar-man.png") image = pipe(image=input_image, prompt=prompt).frames[0] export_to_video(output, "output.mp4") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- Draw Things
Update README.md
Browse files
README.md
CHANGED
|
@@ -72,51 +72,6 @@ widget:
|
|
| 72 |
- [cakeify_16_epochs.safetensors](./cakeify_16_epochs.safetensors) - LoRA Model File
|
| 73 |
- [wan_img2vid_lora_workflow.json](./workflow/wan_img2vid_lora_workflow.json) - Wan I2V with LoRA Workflow for ComfyUI
|
| 74 |
|
| 75 |
-
## Using with Diffusers
|
| 76 |
-
```py
|
| 77 |
-
pip install git+https://github.com/huggingface/diffusers.git
|
| 78 |
-
```
|
| 79 |
-
|
| 80 |
-
```py
|
| 81 |
-
import torch
|
| 82 |
-
from diffusers.utils import export_to_video, load_image
|
| 83 |
-
from diffusers import AutoencoderKLWan, WanImageToVideoPipeline
|
| 84 |
-
from transformers import CLIPVisionModel
|
| 85 |
-
import numpy as np
|
| 86 |
-
|
| 87 |
-
model_id = "Wan-AI/Wan2.1-I2V-14B-480P-Diffusers"
|
| 88 |
-
image_encoder = CLIPVisionModel.from_pretrained(model_id, subfolder="image_encoder", torch_dtype=torch.float32)
|
| 89 |
-
vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", torch_dtype=torch.float32)
|
| 90 |
-
pipe = WanImageToVideoPipeline.from_pretrained(model_id, vae=vae, image_encoder=image_encoder, torch_dtype=torch.bfloat16)
|
| 91 |
-
pipe.to("cuda")
|
| 92 |
-
|
| 93 |
-
pipe.load_lora_weights("Remade/Squish")
|
| 94 |
-
|
| 95 |
-
pipe.enable_model_cpu_offload() #for low-vram environments
|
| 96 |
-
|
| 97 |
-
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."
|
| 98 |
-
|
| 99 |
-
image = load_image("https://huggingface.co/datasets/diffusers/cat_toy_example/resolve/main/1.jpeg")
|
| 100 |
-
|
| 101 |
-
max_area = 480 * 832
|
| 102 |
-
aspect_ratio = image.height / image.width
|
| 103 |
-
mod_value = pipe.vae_scale_factor_spatial * pipe.transformer.config.patch_size[1]
|
| 104 |
-
height = round(np.sqrt(max_area * aspect_ratio)) // mod_value * mod_value
|
| 105 |
-
width = round(np.sqrt(max_area / aspect_ratio)) // mod_value * mod_value
|
| 106 |
-
image = image.resize((width, height))
|
| 107 |
-
|
| 108 |
-
output = pipe(
|
| 109 |
-
image=image,
|
| 110 |
-
prompt=prompt,
|
| 111 |
-
height=height,
|
| 112 |
-
width=width,
|
| 113 |
-
num_frames=81,
|
| 114 |
-
guidance_scale=5.0,
|
| 115 |
-
num_inference_steps=28
|
| 116 |
-
).frames[0]
|
| 117 |
-
export_to_video(output, "output.mp4", fps=16)
|
| 118 |
-
```
|
| 119 |
-
|
| 120 |
---
|
| 121 |
<div style="background-color: #f8f9fa; padding: 20px; border-radius: 10px; margin-bottom: 20px;">
|
| 122 |
<div style="background-color: white; padding: 15px; border-radius: 8px; margin: 15px 0; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
|
|
|
|
| 72 |
- [cakeify_16_epochs.safetensors](./cakeify_16_epochs.safetensors) - LoRA Model File
|
| 73 |
- [wan_img2vid_lora_workflow.json](./workflow/wan_img2vid_lora_workflow.json) - Wan I2V with LoRA Workflow for ComfyUI
|
| 74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
---
|
| 76 |
<div style="background-color: #f8f9fa; padding: 20px; border-radius: 10px; margin-bottom: 20px;">
|
| 77 |
<div style="background-color: white; padding: 15px; border-radius: 8px; margin: 15px 0; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
|