🧪 GitHub | 📖 Playground | 📑 Technical Paper | 💬 Discord
|
让这位女性穿上哥特式黑色牛仔裤、皮夹克,并内搭露脐上衣。 |
1.2) 给她穿上小丑服装。 |
1.3) 让这位女性穿上红色比基尼,并在外面套一件敞开的厚外套。 |
Lucy Edit Dev 是一个开源权重的视频编辑模型,它能够通过自由文本提示对视频执行指令引导的编辑——支持多种编辑类型,例如服装和配饰更改、角色替换、物体插入和场景替换,同时完美保留视频的运动和构图。
ℹ️ 模型大小:约 50 亿参数。基于 Wan2.2 5B 构建。
|
1.1) 将人物转换为外星人 |
1.2) 将人物转换为熊 |
1.3) 添加下雪效果 |
|
2.1) 将女性转换为哈莉·奎茵 |
2.2) 将女性转换为乐高形象 |
2.3) 将衬衫转换为运动球衣 |
注意:上述提示词未经优化,按照下方“提示词指南”部分所述,优化后的提示词能使模型发挥更佳效果。
pip install git+https://github.com/huggingface/diffusers为获得最佳体验,请参考“提示词指南与支持的编辑操作”部分。
from typing import List
import torch
from PIL import Image
from diffusers import AutoencoderKLWan, LucyEditPipeline
from diffusers.utils import export_to_video, load_video
# Arguments
url = "https://d2drjpuinn46lb.cloudfront.net/painter_original_edit.mp4"
prompt = "Change the apron and blouse to a classic clown costume: satin polka-dot jumpsuit in bright primary colors, ruffled white collar, oversized pom-pom buttons, white gloves, oversized red shoes, red foam nose; soft window light from left, eye-level medium shot, natural folds and fabric highlights."
negative_prompt = ""
num_frames = 81
height = 480
width = 832
# Load video
def convert_video(video: List[Image.Image]) -> List[Image.Image]:
video = load_video(url)[:num_frames]
video = [video[i].resize((width, height)) for i in range(num_frames)]
return video
video = load_video(url, convert_method=convert_video)
# Load model
model_id = "decart-ai/Lucy-Edit-Dev"
vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", torch_dtype=torch.float32)
pipe = LucyEditPipeline.from_pretrained(model_id, vae=vae, torch_dtype=torch.bfloat16)
pipe.to("cuda")
# Generate video
output = pipe(
prompt=prompt,
video=video,
negative_prompt=negative_prompt,
height=480,
width=832,
num_frames=81,
guidance_scale=5.0
).frames[0]
# Export video
export_to_video(output, "output.mp4", fps=24)Lucy Edit 专为精准、逼真且保留身份特征的视频编辑而打造。
约 20-30 个描述性词语的提示词效果最佳。使用正确的触发词有助于模型理解您的意图。
✅ 性能最佳。Lucy Edit 擅长在保留动作、姿势和身份特征的同时更换服装。
示例:“将衬衫更改为带有宽袖子和花纹面料的和服。”
✅ 效果显著。适用于将人物转换为新角色或生物。详细的提示词是关键。
示例:“将该人物替换为老虎,具有橙色条纹皮毛、肌肉发达的体型和发光的绿色眼睛。”
示例:“将该人物替换为二维动漫角色,有着大眼睛、蓝色长袍和战斗伤疤。”
✅ 适用于结构保留的替换。非常适合替换为相似尺寸的另一对象。
示例:“将苹果替换为发出蓝光的发光水晶球。”
⚠️ 可靠性参差不齐。有时效果微妙,有时则过于夸张。使用精确描述时效果最佳。
示例:“将夹克颜色更改为深红色皮革,带有光泽质感。”
⚠️ 通常会附着于主体。最适用于可穿戴或手持道具。
示例:“在人物头上添加一顶金色皇冠,上面装饰有华丽的珠宝。”
⚠️ 对背景或场景范围的更改有效,可能会改变主体。用于改变环境或风格,常常会改变主体的身份特征。
示例:“将阳光明媚的海滩转换为飘着雪花的雪域苔原。”
LucyEditPipeline)@article{decart2025lucyedit,
title = {Lucy Edit: Open-Weight Text-Guided Video Editing},
author = {DecartAI Team},
year = {2025}
url = { https://d2drjpuinn46lb.cloudfront.net/Lucy_Edit__High_Fidelity_Text_Guided_Video_Editing.pdf}
}Lucy Edit Dev 基于 Wan2.2(5B)的优秀基础构建而成,同时感谢包括 diffusers 和 Hugging Face 在内的广大开源社区。