mcpField
F
fal-video-to-video

fal-video-to-video

github.com/josiahsiegel创意与媒体5983 次安装19 周前更新
代码仓库

关于 fal-video-to-video

fal-video-to-video 是使用 fal.ai 模型编辑和转换现有视频的参考技能,涵盖风格与对象编辑、混剪、升频和帧插值,并介绍相关端点及参数。

主要功能

  1. 01应用风格转换和通用视频编辑
  2. 02替换或移除视频中的对象
  3. 03使用 Sora 混剪视频
  4. 04将分辨率提升 2 倍或 4 倍
  5. 05插帧至指定帧率

适用场景

  1. 01将视频片段转换为动漫或黑色电影风格
  2. 02替换或移除场景中的元素
  3. 03提升低分辨率素材
  4. 04提高帧率以获得更流畅的运动

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/josiahsiegel/claude-plugin-marketplace --skill fal-video-to-video

安装后在 Claude Code 中输入/fal-video-to-video确认已加载。

详细介绍

快速参考

任务端点关键参数
风格化/编辑fal-ai/kling-video/o1/video-to-video/editedit_type
混剪fal-ai/sora/remixprompt
超分辨率fal-ai/video-upscalerscale: 2,4
插帧fal-ai/frame-interpolationtarget_fps
编辑类型用例
general色彩、光线、画质
style动漫、绘画、黑色电影风格
object替换/移除元素
风格关键词效果
"anime style"日本动画
"oil painting"纹理笔触
"noir"高对比度黑白效果
"cyberpunk"霓虹灯科幻未来风格
超分倍率文件大小变化
2x文件大小变为 4 倍
4x文件大小变为 16 倍

何时使用此技能

用于视频编辑和转换:

  • 为视频应用风格迁移
  • 提升低分辨率视频的分辨率
  • 提高帧率,让动作更流畅
  • 替换或移除物体
  • 增强视频画质

相关技能:

  • 文本生成视频:参见 fal-text-to-video
  • 图像生成视频:参见 fal-image-to-video
  • 模型选择:参见 fal-model-guide

fal.ai 视频到视频模型

fal.ai 视频编辑、转换和超分辨率模型的完整参考。

Kling O1 视频编辑

Kling O1 视频到视频编辑

端点: fal-ai/kling-video/o1/video-to-video/edit 最适用于: 综合性视频编辑与转换

import { fal } from "@fal-ai/client";

const result = await fal.subscribe("fal-ai/kling-video/o1/video-to-video/edit", {
  input: {
    prompt: "Transform into an anime style with vibrant colors",
    video_url: "https://example.com/original-video.mp4",
    edit_type: "style",
    negative_prompt: "blurry, distorted, low quality"
  }
});

console.log(result.video.url);
import fal_client

result = fal_client.subscribe(
    "fal-ai/kling-video/o1/video-to-video/edit",
    arguments={
        "prompt": "Transform into anime style",
        "video_url": "https://example.com/video.mp4",
        "edit_type": "style"
    }
)
print(result["video"]["url"])

编辑类型:

类型描述用例
general通用编辑任意转换
style风格迁移艺术效果
object物体替换/编辑更改特定元素

参数:

参数类型描述
promptstring编辑指令
video_urlstring源视频 URL
edit_typestring"general"、"style"、"object"
negative_promptstring需要避免的内容
Kling O1 示例

风格迁移:

const result = await fal.subscribe("fal-ai/kling-video/o1/video-to-video/edit", {
  input: {
    prompt: "Transform into a watercolor painting style with soft brushstrokes",
    video_url: sourceVideoUrl,
    edit_type: "style",
    negative_prompt: "harsh edges, digital artifacts"
  }
});

物体编辑:

const result = await fal.subscribe("fal-ai/kling-video/o1/video-to-video/edit", {
  input: {
    prompt: "Change the red car to a blue sports car",
    video_url: sourceVideoUrl,
    edit_type: "object"
  }
});

常规转换:

const result = await fal.subscribe("fal-ai/kling-video/o1/video-to-video/edit", {
  input: {
    prompt: "Make it look like a sunny summer day instead of overcast",
    video_url: sourceVideoUrl,
    edit_type: "general"
  }
});

Sora 2 混剪

Sora 混剪(视频转换)

端点: fal-ai/sora/remix 最适用于: 创意视频混剪与转换

const result = await fal.subscribe("fal-ai/sora/remix", {
  input: {
    prompt: "Transform this into a cinematic sci-fi scene with futuristic elements",
    video_url: "https://example.com/original.mp4",
    aspect_ratio: "16:9"
  }
});

console.log(result.video.url);

Sora 混剪参数:

参数类型描述
promptstring转换说明
video_urlstring源视频 URL
aspect_ratiostring"16:9"、"9:16"、"1:1"

视频超分辨率

视频超分辨率工具

端点: fal-ai/video-upscaler 最适用于: 提升视频分辨率

const result = await fal.subscribe("fal-ai/video-upscaler", {
  input: {
    video_url: "https://example.com/low-res-video.mp4",
    scale: 2  // 2x or 4x upscale
  }
});

console.log(result.video.url);
result = fal_client.subscribe(
    "fal-ai/video-upscaler",
    arguments={
        "video_url": "https://example.com/video.mp4",
        "scale": 2
    }
)

参数:

参数类型值描述
video_urlstring-源视频 URL
scalenumber2, 4超分倍率
TopazVideoAI(如果可用)

端点: fal-ai/topaz-video-ai 最适用于: 专业视频增强

const result = await fal.subscribe("fal-ai/topaz-video-ai", {
  input: {
    video_url: "https://example.com/video.mp4",
    enhancement_type: "upscale",
    target_resolution: "4k"
  }
});

视频帧插值

帧插值

端点: fal-ai/frame-interpolation 最适用于: 平滑动作、提高帧率

const result = await fal.subscribe("fal-ai/frame-interpolation", {
  input: {
    video_url: "https://example.com/24fps-video.mp4",
    target_fps: 60,
    interpolation_mode: "smooth"
  }
});

参数:

参数类型描述
video_urlstring源视频
target_fpsnumber目标帧率(30、60、120)
interpolation_modestring"smooth"、"natural"

视频风格迁移

通用风格迁移流程
// Apply artistic style to video
async function applyVideoStyle(videoUrl: string, style: string) {
  const result = await fal.subscribe("fal-ai/kling-video/o1/video-to-video/edit", {
    input: {
      prompt: `Transform into ${style} style`,
      video_url: videoUrl,
      edit_type: "style"
    }
  });
  return result.video.url;
}

// Usage
const animeVideo = await applyVideoStyle(originalVideo, "anime");
const oilPaintingVideo = await applyVideoStyle(originalVideo, "oil painting");
const pixelArtVideo = await applyVideoStyle(originalVideo, "pixel art");
风格关键词
风格提示词示例
动漫“日本动漫风格,赛璐珞着色”
水彩“柔和的水彩画,色彩流动”
油画“古典油画,笔触质感丰富”
像素艺术“8 位像素艺术复古游戏风格”
黑色电影“黑白黑色电影,高对比度”
赛博朋克“霓虹赛博朋克美学,未来感”
素描“手绘铅笔素描风格”
漫画“漫画风格,轮廓粗犷”

视频增强技术

降噪
const result = await fal.subscribe("fal-ai/kling-video/o1/video-to-video/edit", {
  input: {
    prompt: "Clean and enhance video quality, reduce noise and grain",
    video_url: noisyVideoUrl,
    edit_type: "general",
    negative_prompt: "grainy, noisy, artifacts"
  }
});
色彩校正
const result = await fal.subscribe("fal-ai/kling-video/o1/video-to-video/edit", {
  input: {
    prompt: "Enhance colors to be more vibrant and natural, improve contrast",
    video_url: flatVideoUrl,
    edit_type: "general"
  }
});
光照增强
const result = await fal.subscribe("fal-ai/kling-video/o1/video-to-video/edit", {
  input: {
    prompt: "Improve lighting, add warm golden hour glow",
    video_url: darkVideoUrl,
    edit_type: "general"
  }
});

视频对象编辑

对象替换
const result = await fal.subscribe("fal-ai/kling-video/o1/video-to-video/edit", {
  input: {
    prompt: "Replace the bicycle with a motorcycle",
    video_url: sourceVideoUrl,
    edit_type: "object"
  }
});
对象移除
const result = await fal.subscribe("fal-ai/kling-video/o1/video-to-video/edit", {
  input: {
    prompt: "Remove the person in the background, fill with natural scenery",
    video_url: sourceVideoUrl,
    edit_type: "object"
  }
});
对象添加
const result = await fal.subscribe("fal-ai/kling-video/o1/video-to-video/edit", {
  input: {
    prompt: "Add falling snow throughout the scene",
    video_url: sourceVideoUrl,
    edit_type: "object"
  }
});

完整参数参考

interface VideoToVideoInput {
  // Required
  video_url: string;

  // For editing models
  prompt?: string;
  edit_type?: "general" | "style" | "object";
  negative_prompt?: string;

  // For upscaling
  scale?: number;  // 2 or 4

  // For frame interpolation
  target_fps?: number;
  interpolation_mode?: string;

  // Output
  aspect_ratio?: string;
}

工作流示例

完整视频增强流水线
async function enhanceVideo(sourceUrl: string) {
  // 1. Upscale resolution
  const upscaled = await fal.subscribe("fal-ai/video-upscaler", {
    input: {
      video_url: sourceUrl,
      scale: 2
    }
  });

  // 2. Enhance quality
  const enhanced = await fal.subscribe("fal-ai/kling-video/o1/video-to-video/edit", {
    input: {
      prompt: "Enhance video quality, improve sharpness and colors",
      video_url: upscaled.video.url,
      edit_type: "general"
    }
  });

  // 3. Smooth motion (optional)
  const smoothed = await fal.subscribe("fal-ai/frame-interpolation", {
    input: {
      video_url: enhanced.video.url,
      target_fps: 60
    }
  });

  return smoothed.video.url;
}
风格迁移工作流
async function styleTransferVideo(
  sourceUrl: string,
  targetStyle: string
) {
  // Apply style transformation
  const styled = await fal.subscribe("fal-ai/kling-video/o1/video-to-video/edit", {
    input: {
      prompt: `Transform into ${targetStyle} style, maintain motion consistency`,
      video_url: sourceUrl,
      edit_type: "style",
      negative_prompt: "flickering, inconsistent, artifacts"
    }
  });

  return styled.video.url;
}

// Usage
const animeVersion = await styleTransferVideo(original, "anime");
const paintingVersion = await styleTransferVideo(original, "impressionist oil painting");
批量视频处理
async function processVideosBatch(
  videos: string[],
  transformation: string
) {
  const results = await Promise.all(
    videos.map(video =>
      fal.subscribe("fal-ai/kling-video/o1/video-to-video/edit", {
        input: {
          prompt: transformation,
          video_url: video,
          edit_type: "general"
        }
      })
    )
  );

  return results.map(r => r.video.url);
}

模型比较

模型编辑风格放大速度
Kling O1完整完整否中等
Sora Remix有限完整否慢
Video Upscaler否否完整快

最佳实践

风格迁移
  1. 保持一致——使用具体的风格描述
  2. 避免闪烁——在负面提示词中加入“一致”
  3. 先测试片段——先处理较短的片段
  4. 保持原有特征——不要过度转换
对象编辑
  1. 描述具体——明确指出要更改的对象
  2. 提供上下文——清楚描述替换内容
  3. 考虑运动——确保编辑效果适用于运动场景
  4. 检查边界——对象边缘应自然融合
放大
  1. 源质量很重要——输入干净,输出效果更好
  2. 不要过度放大——通常 2 倍就足够
  3. 考虑文件大小——分辨率越高,文件越大
  4. 先测试——用较短片段预览
常规增强
  1. 逐步调整——不要试图一次性解决所有问题
  2. 保留原意——保持原有氛围和风格
  3. 检查伪影——留意新引入的错误
  4. 反复迭代——可能需要多次处理

常见问题和解决方案

问题原因解决方案
闪烁帧不一致在提示词中加入“一致、稳定”
色彩偏移编辑过于激进使用更温和的提示词
细节丢失转换过度降低编辑强度
伪影压缩问题使用质量更高的源文件
运动模糊帧插值使用“自然”模式

文件大小注意事项

操作大小影响
2 倍放大大 4 倍
4 倍放大大 16 倍
帧插值大 2–4 倍
风格迁移大小相近

处理视频时,请始终考虑存储空间和带宽。

评论

支持 Markdown