图像安装
- 作者仓库星标 0
- 作者更新于 实时读取
- 作者仓库 free-image-and-video-generation-skill
- 领域
- AI 智能
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 83 / 100 · 社区维护
- 作者 / 版本 / 许可
- @xramjetx · 未声明 license
- Token 消耗评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部 API Key
- 需要 · Vendor-specific
- 兼容的系统
- 未声明(默认跨平台)
- 底层运行要求
- Python >=3.10
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 读取环境变量
- 网络行为
- 允许外网请求
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。;检出高风险片段:pipe_curl_to_shell
---
name: free-image-and-video-generation
description: Free local AI image and video processing toolkit with cloud AI generation. Local tools: upscale…
category: AI 智能
runtime: Python
---
# free-image-and-video-generation 输出预览
## PART A: 任务判断
- 适用问题:提示词、Agent 工作流、模型评估或自动化推理。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Prerequisites / Available Tools / Usage”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于提示词、Agent 工作流、模型评估或自动化推理,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Prerequisites / Available Tools / Usage”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、执行终端命令、读取环境变量、会按任务需要访问外部网络、需要准备 Vendor-specific API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件、执行终端命令、读取环境变量;会按任务需要访问外部网络;需要准备 Vendor-specific API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文没有稳定的斜杠命令要求。安装验证后通常全局生效,直接在对话里点名这个 Skill 并描述任务即可。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件、执行终端命令、读取环境变量。
先用一个小任务确认它会围绕“Prerequisites / Available Tools / Usage”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: free-image-and-video-generation
description: Free local AI image and video processing toolkit with cloud AI generation. Local tools: upscale…
category: AI 智能
source: xramjetx/free-image-and-video-generation-skill
---
# free-image-and-video-generation
## 什么时候使用
- 把 AI / Agent方向的常用动作沉淀成 Agent 可调用的技能 适合处理AI Agent、提示词、模型评估与自动化推理,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查…
- 面向提示词、Agent 工作流、模型评估或自动化推理,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Prerequisites / Available Tools / Usage」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件、执行终端命令、读取环境变量;会按任务需要访问外部网络;需要准备 Vendor-specific API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "free-image-and-video-generation" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Prerequisites / Available Tools / Usage
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> Python | 读取文件、写入/修改文件、执行终端命令、读取环境变量 | 会按任务需要访问外部网络
安全层 -> 需要准备 Vendor-specific API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} Free Image & Video Processing Toolkit
7 free local AI tools + cloud AI generation (300+ models via Atlas Cloud API).
Local tools run 100% on your machine — no API keys, no cloud costs. Cloud generation tools provide access to state-of-the-art AI models for image and video creation.
Prerequisites
- Python 3.10+ installed
- uv installed (
curl -LsSf https://astral.sh/uv/install.sh | sh) - FFmpeg installed (
brew install ffmpeg/apt install ffmpeg/winget install ffmpeg)
Available Tools
| Tool | Script | What It Does |
|---|---|---|
| Image Upscale | scripts/upscale.py |
2x/4x super resolution using Real-ESRGAN |
| Face Enhance | scripts/face-enhance.py |
Restore and enhance faces using GFPGAN + CodeFormer |
| Background Remove | scripts/bg-remove.py |
Remove image backgrounds, output transparent PNG |
| Object Erase | scripts/erase.py |
Erase unwanted objects using LaMa inpainting |
| Face Swap | scripts/face-swap.py |
Swap faces between images using InsightFace |
| Smart Segment | scripts/segment.py |
Segment anything in images using FastSAM |
| Media Process | scripts/media-process.py |
Convert, compress, resize, extract with FFmpeg |
| AI Generate | scripts/ai-generate.py |
Generate images/videos with 300+ cloud AI models |
Usage
All scripts use uv run for zero-setup execution — dependencies are automatically installed on first run.
Image Upscale (Real-ESRGAN)
Upscale low-resolution images by 2x or 4x with AI super resolution.
# 4x upscale (default)
uv run scripts/upscale.py input.jpg
# 2x upscale
uv run scripts/upscale.py input.jpg --scale 2
# Upscale with face enhancement
uv run scripts/upscale.py input.jpg --face-enhance
# Batch upscale a folder
uv run scripts/upscale.py ./photos/ --scale 4
# Custom output path
uv run scripts/upscale.py input.jpg -o upscaled.png
Face Enhance (GFPGAN + CodeFormer)
Restore old photos, enhance blurry faces, fix low-quality portraits.
# Enhance faces in an image (GFPGAN, default)
uv run scripts/face-enhance.py photo.jpg
# Use CodeFormer (better fidelity control)
uv run scripts/face-enhance.py photo.jpg --method codeformer
# Adjust fidelity (0=quality, 1=fidelity, default 0.5)
uv run scripts/face-enhance.py photo.jpg --method codeformer --fidelity 0.7
# Also upscale background (2x)
uv run scripts/face-enhance.py photo.jpg --bg-upscale 2
# Batch process
uv run scripts/face-enhance.py ./old-photos/
Background Remove (rembg)
Remove backgrounds from images, output transparent PNG. Supports multiple AI models.
# Remove background (default u2net model)
uv run scripts/bg-remove.py product.jpg
# Use specific model
uv run scripts/bg-remove.py photo.jpg --model isnet-general-use
# Batch process folder
uv run scripts/bg-remove.py ./products/ -o ./transparent/
# Keep only the foreground (alpha matting for fine edges)
uv run scripts/bg-remove.py portrait.jpg --alpha-matting
# Available models: u2net, u2netp, u2net_human_seg, u2net_cloth_seg,
# silueta, isnet-general-use, isnet-anime, sam
Object Erase (LaMa Inpainting)
Remove unwanted objects from images using a mask.
# Erase objects (white area in mask = erase)
uv run scripts/erase.py image.png --mask mask.png
# Auto-generate mask from coordinates (x,y,width,height)
uv run scripts/erase.py image.png --region 100,200,150,150
# Batch erase with matching masks (image1.png + image1_mask.png)
uv run scripts/erase.py ./images/ --mask-dir ./masks/
Face Swap (InsightFace)
Swap faces between two images.
# Swap face from source to target
uv run scripts/face-swap.py --source face.jpg --target photo.jpg
# Swap specific face index (when multiple faces detected)
uv run scripts/face-swap.py --source face.jpg --target group.jpg --face-index 0
# Custom output
uv run scripts/face-swap.py --source face.jpg --target photo.jpg -o result.png
Smart Segment (FastSAM)
Segment any object in an image using text prompt, point, or bounding box.
# Segment everything
uv run scripts/segment.py image.jpg
# Segment by text prompt
uv run scripts/segment.py image.jpg --text "the dog"
# Segment by point (x, y)
uv run scripts/segment.py image.jpg --point 400,300
# Segment by bounding box (x1,y1,x2,y2)
uv run scripts/segment.py image.jpg --box 100,100,400,400
# Output mask only
uv run scripts/segment.py image.jpg --text "car" --mask-only
Media Process (FFmpeg)
Convert, compress, resize, extract frames, merge audio/video — powered by FFmpeg.
# Convert format
uv run scripts/media-process.py convert input.mp4 output.webm
# Compress video (target size in MB)
uv run scripts/media-process.py compress input.mp4 --target-size 10
# Resize video
uv run scripts/media-process.py resize input.mp4 --width 1280 --height 720
# Extract frames as images
uv run scripts/media-process.py frames input.mp4 --fps 1 --output ./frames/
# Extract audio
uv run scripts/media-process.py audio input.mp4 -o audio.mp3
# Create GIF from video
uv run scripts/media-process.py gif input.mp4 --start 5 --duration 3 --fps 15
# Trim video
uv run scripts/media-process.py trim input.mp4 --start 00:01:00 --end 00:02:30
# Merge multiple videos
uv run scripts/media-process.py merge video1.mp4 video2.mp4 video3.mp4 -o combined.mp4
# Add watermark
uv run scripts/media-process.py watermark input.mp4 --image logo.png --position bottom-right
# Get media info
uv run scripts/media-process.py info input.mp4
AI Generate (Atlas Cloud API) — Gold Sponsor
Generate images and videos using 300+ state-of-the-art AI models. Requires an Atlas Cloud API key.
IMPORTANT for AI agents: Before calling this script, you MUST first use Atlas Cloud MCP tools to find the correct model ID and its required parameters:
- Call
atlas_list_modelsto browse available models, oratlas_search_docsto search for a specific model - Call
atlas_get_model_infowith the model ID to get the exact parameter schema (different models use different parameters — some usesize, others useaspect_ratio+resolution, etc.) - Then call the script with
--model <full_model_id>and the correct parameters
# Generate image (pass full model ID from Atlas Cloud)
uv run scripts/ai-generate.py image "A cat astronaut on the moon" --model black-forest-labs/flux-schnell --size 1024*1024
# Models using aspect_ratio + resolution (e.g. Nano Banana 2, Imagen4)
uv run scripts/ai-generate.py image "Anime girl with blue hair" --model google/nano-banana-2/text-to-image --aspect-ratio 1:1 --resolution 1k
# Models using size presets (e.g. Seedream)
uv run scripts/ai-generate.py image "Product photo on marble" --model bytedance/seedream-v5.0-lite --size 2048*2048
# Edit existing image
uv run scripts/ai-generate.py image "Make the sky sunset orange" --model bytedance/seedream-v5.0-lite/edit --image photo.jpg
# Generate video
uv run scripts/ai-generate.py video "Timelapse of cherry blossoms" --model alibaba/wan-2.6/text-to-video --size 1280*720
# Image-to-video
uv run scripts/ai-generate.py video "The person starts walking" --model alibaba/wan-2.6/image-to-video --image portrait.jpg
# Pass extra model-specific parameters as JSON
uv run scripts/ai-generate.py image "A logo" --model google/imagen4-ultra --extra '{"num_images": 4}'
# NSFW mode
uv run scripts/ai-generate.py image "Artistic figure study" --model black-forest-labs/flux-dev-lora --nsfw
Setup: Set ATLAS_CLOUD_API_KEY in environment or .env file. Get your key at atlascloud.ai.
Output
All tools save output to ./output/ by default. Use -o or --output to specify a custom path.
Models
Models are automatically downloaded on first use and cached locally:
| Tool | Model | Size | Cache Location |
|---|---|---|---|
| Upscale | RealESRGAN_x4plus | ~64MB | ~/.cache/realesrgan/ |
| Face Enhance | GFPGANv1.4 | ~348MB | ~/.cache/gfpgan/ |
| Face Enhance | CodeFormer | ~376MB | ~/.cache/codeformer/ |
| Background Remove | u2net | ~176MB | ~/.u2net/ |
| Object Erase | LaMa | ~200MB | ~/.cache/lama/ |
| Face Swap | buffalo_l + inswapper | ~500MB | ~/.insightface/ |
| Smart Segment | FastSAM-s | ~23MB | auto-downloaded by ultralytics |
Total first-run download: ~1.5GB. All subsequent runs use cached models.
Tips
- GPU Acceleration: All tools automatically use CUDA/MPS if available, falling back to CPU
- Batch Processing: Most tools accept a folder path for batch processing
- Memory: Face swap and segmentation may need 4GB+ RAM for large images
- First Run: First execution downloads AI models — subsequent runs are instant
Workflow Examples
Combine local processing with cloud AI generation:
# 1. Generate a product image with AI
uv run scripts/ai-generate.py image "Minimalist perfume bottle, studio lighting" --model bytedance/seedream-v5.0-lite --size 2048*2048
# 2. Upscale to 4x resolution
uv run scripts/upscale.py ./output/seedream-v5.0-lite_*.png --scale 4
# 3. Remove background for e-commerce
uv run scripts/bg-remove.py ./output/*_x4.png --alpha-matting
# 4. Generate a product video
uv run scripts/ai-generate.py video "A perfume bottle rotating slowly" --model kwaivgi/kling-v3.0-pro/text-to-video --duration 5
# 5. Add watermark to the video
uv run scripts/media-process.py watermark ./output/text-to-video_*.mp4 --image logo.png
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核