Communitygithub.com

PrunaAI/pruna-skills

当用户想要编辑现有照片时使用——更换服装或背景、根据参考图像合成,或执行基于提示的编辑。

pruna-skills 是什么?

这是一个用于图像编辑的AI技能,专为Pruna API设计,支持用户对现有照片进行精准编辑,例如更换服装、背景,或根据参考图像进行合成。该技能提供结构化的提示词编写框架,强调针对性(surgical)和忠实性(faithful),确保只修改用户要求的元素,而保持身份、姿势、光线等其余部分不变。它集成generation-diversity技能中的随机种子仪式来增强多样性,并通过image-prompting技能中的编辑提示词规范来编写精确指令。用户需先上传参考图像,再通过异步HTTP请求调用p-image-edit模型,并可选择后续接p-image-upscale或p-video-*系列技能进行扩展。该技能适用于需要高控制度和一致性的图像编辑场景,而非从头生成新图像或简单的虚拟试穿。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/PrunaAI/pruna-skills/tree/HEAD/skills/image/p-image-edit

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

前提条件

在生成之前,先安装并加载这些技能(如果已通过@pruna在上下文中,可跳过):

技能描述安装命令
generation-diversity在编写任何生成提示词时使用——仪式种子、显式结构、场景轴,以及在付费API调用前的质量门控。npx skills add PrunaAI/pruna-skills@generation-diversity -y
image-prompting在为任何生成模型编写静态图像提示词时使用——构图、身份说明、编辑、试穿以及逼真角色。npx skills add PrunaAI/pruna-skills@image-prompting -y
video-prompting在为任何生成模型编写视频或动态提示词时使用——戏剧性、镜头、符合物理的运动、帧锚点以及片段链接。npx skills add PrunaAI/pruna-skills@video-prompting -y
pruna-api在任何Pruna或Replicate HTTP调用前使用——凭证、上传/轮询/下载、并行批处理以及代理安全性。npx skills add PrunaAI/pruna-skills@pruna-api -y

或一次性安装完整套件:npx skills add PrunaAI/pruna-skills@pruna -y

遵循每个技能的 生成前 / 构建部分 —— 此处不再重复说明内容。

代理习惯

在 首次回复 中,将 `p-image-edit` 放在反引号中,确认 PRUNA_API_KEY,然后询问源照片(及编辑需求)。必要时打开接收渠道 → generation-diversity 澄清接收。使用 提示词构建(动态 + 忠实) 起草编辑。当任务是基于产品展示图进行服装合身调整时,重定向到 p-image-try-on。

提示词构建(动态 + 忠实)

编辑提示词应 精准针对性 且 锁定需求。只更改用户要求的元素;保持其他一切不变。多样性适用于 如何 表述更改 —— 而非凭空创造新场景。

应该不应该
公式:更改[具体事物]。保持[身份/姿势/光线/背景]不变。(image-prompting 编辑构建)让它更好 / 仅基于情绪的改写而忽略需求
明确指出用户提及的每个 必须保留 的元素(面部、服装、姿势、背景、产品)省略保留条款,寄希望于模型自动保留
在起草前从 generation-diversity 中执行新的仪式种子;在需求允许时变化自由措辞(材质、十六进制色、镜头细节)当用户要求其他内容时,直接复制此技能的示例(soft gradient)
合成时指向参考:face from image 1, outfit from image 2模糊的 combine these images
在措辞未锁定时,在 POST 前展示编辑提示词静默编辑,导致更改主题、物种、年龄或未要求的区域

忠实度检查(付费前): 提示词必须仍能满足用户的更改 以及 所有明确声明的保留内容。如果缺少某个保留条件,则补充。当用户只要求背景替换时,不要“美化”背景/演员。

何时不使用

改用其他技能:

技能描述安装命令
p-image当用户明确需要最快、最经济的照片生成时使用——情绪板、批量面板或快速迭代,而非需要受控逼真或图像内文字的场景。npx skills add PrunaAI/pruna-skills@p-image -y
p-image-try-on当用户想要虚拟试穿时使用——为人物穿上参考照片中的服装,适用于时尚或电商。npx skills add PrunaAI/pruna-skills@p-image-try-on -y
p-image-upscale当用户想要放大或锐化现有图像以用于打印、大幅裁剪或更高质量交付时使用。npx skills add PrunaAI/pruna-skills@p-image-upscale -y

HTTP (curl)

上传参考图像

curl -X POST "https://api.pruna.ai/v1/files" \
  -H "apikey: ${PRUNA_API_KEY}" \
  -F "content=@/path/to/reference.png"

使用每个响应中的 urls.get 作为 input.images。

创建(异步——推荐)

curl -X POST 'https://api.pruna.ai/v1/predictions' \
  -H 'Content-Type: application/json' \
  -H "apikey: ${PRUNA_API_KEY}" \
  -H 'Model: p-image-edit' \
  -d '{
    "input": {
      "prompt": "Change background to soft gradient, keep subject identical",
      "images": ["https://api.pruna.ai/v1/files/FILE_ID"],
      "aspect_ratio": "9:16"
    }
  }'

轮询并下载:遵循 pruna-api。

在编写提示词之前,先完成 generation-diversity 中的随机种子仪式 —— 不要 将仪式字符串作为 API 的 seed 参数传递。仅当用户要求可复现性时才使用可选的 seed。

创建(同步——仅快速测试)

curl -X POST 'https://api.pruna.ai/v1/predictions' \
  -H 'Content-Type: application/json' \
  -H "apikey: ${PRUNA_API_KEY}" \
  -H 'Model: p-image-edit' \
  -H 'Try-Sync: true' \
  -d '{
    "input": {
      "prompt": "Change background to soft gradient, keep subject identical",
      "images": ["https://api.pruna.ai/v1/files/FILE_ID"],
      "aspect_ratio": "9:16"
    }
  }'

编辑流程

遵循 generation-diversity 的 静态图像提示词流程(编辑部分):

  1. 锁定更改 + 保留条件 —— 用户的针对性需求;公式见 提示词构建(动态 + 忠实)。
  2. 上传参考图像 —— POST /v1/files;urls.get → input.images(1–5 张)。切勿编造文件 URL。
  3. 仪式种子 → 起草编辑提示词(image-prompting 编辑构建) → 忠实度检查(确保每个保留条款都存在)。
  4. 确认 —— prompt、参考图像、aspect_ratio、turbo(困难编辑时关闭)。
  5. POST —— 使用以下异步 curl 命令;在放大或生成视频前进行清单检查。

宽高比: 编辑时优先使用 match_input_image;输出应保持原画面宽高比 —— 如果发生偏移,使用相同的参考 URL 和明确的保留条款重试。

Pruna 提示: 头像流程 —— 从锁定的 放大后 英雄 URL 进行编辑;在 p-video* 前再次放大 —— 切勿将原始编辑 URL 直接传递给视频模型。

非编辑场景: 从头生成新主体 → p-image。基于产品展示图进行服装合身 → p-image-try-on。

多参考图像(最多 5 张): 按角色索引参考图像 —— 例如三参考合成:面部来自图像 1,服装来自图像 2,咖啡馆来自图像 3;对于复杂合成,设置 turbo: false。完整模式见 image-prompting 的 p-image-edit-prompting。

必备输入

  • prompt(字符串)
  • images(包含 1–5 个 URL 的数组,通常为 https://api.pruna.ai/v1/files/{id})

常用可选字段

  • aspect_ratio: match_input_image、1:1、16:9、9:16 等。
  • turbo(布尔值,默认 true;对于较难的编辑请关闭)
  • seed、disable_safety_checker

典型后续步骤

此技能之后的常见后续操作:

技能描述安装命令
p-image-upscale当用户想要放大或锐化现有图像以用于打印、大幅裁剪或更高质量交付时使用。npx skills add PrunaAI/pruna-skills@p-image-upscale -y
p-video-2-pro当用户想要从文本或起始/结束帧生成电影级短片时使用 —— 产品广告、纪录片镜头或带生成音频的对话。不适用于 1080p、导入音轨或仅限主持人的头部特写。npx skills add PrunaAI/pruna-skills@p-video-2-pro -y
p-video-2当用户想要从文本、图像或导入的音频生成精修短片时使用 —— 1080p B-roll、起始/结束帧动画或带混合音轨的动态镜头。不适用于电影级生成音频的片段或仅限主持人的头部特写。npx skills add PrunaAI/pruna-skills@p-video-2 -y
p-video当用户想要从文本或图像生成简单的短片时使用 —— 快速 B-roll、草稿或起始/结束帧动画。不适用于需要电影级生成、最高质量、严格唇形同步或以 1080p 导入音频的场景。npx skills add PrunaAI/pruna-skills@p-video -y
p-video-edit当用户想要通过文本指令编辑现有视频时使用 —— 重新着色、改变风格、移除或添加对象、更改环境或光线、更新屏幕上的文字,或应用可选的参考引导产品和配饰编辑。不适用于从头创建新片段或使用 ffmpeg 组装。npx skills add PrunaAI/pruna-skills@p-video-edit -y
p-video-avatar当用户希望一个真人形象在镜头前念台词时使用 —— 从肖像照片生成的唇形同步主持人、代言人或配音头像。npx skills add PrunaAI/pruna-skills@p-video-avatar -y
avatar-multi-scene当用户希望同一个人主持多个片段时使用 —— 多段 UGC、对比视频或混合演讲和动画场景且保持连续性的内容。npx skills add PrunaAI/pruna-skills@avatar-multi-scene -y
narrated-multi-scene当用户想要一个带旁白的多段故事时使用 —— 分集 B-roll、分章宣传片或几个链接的视频场景,无画面对话。npx skills add PrunaAI/pruna-skills@narrated-multi-scene -y
visual-transition-reel当用户想要一个带镜头转场的蒙太奇时使用 —— 动作序列或旁白可选的多个场景片段。npx skills add PrunaAI/pruna-skills@visual-transition-reel -y

Individual skills in this repo

This repo contains 13 individual skills — each has its own dedicated page.

PrunaAI/pruna-skills

Use when someone needs spoken narration or voiceover — explainer tracks, documentary lines, or voice to pair with generated video.

PrunaAI/pruna-skills

Use when someone wants an original AI song with vocals — sung lyrics, a style prompt track, or source audio for a music video.

PrunaAI/pruna-skills

Use when someone needs word-level timestamps from audio — lyric alignment, cut-safe line boundaries, or caption source timing before burn-in with video-editing.

PrunaAI/pruna-skills

Use before any Pruna or Replicate HTTP call — credentials, upload/poll/download, parallel batches, and agent safety.

PrunaAI/pruna-skills

Use when assembling or polishing already-rendered clips with ffmpeg — concat, crossfades, burned captions and subtitles, text/logo overlays, before/after sliders, background music beds, platform export — or when composing a multi-layer HTML combination video with Hyperframes. Not for AI video generation, prompt craft, or model-based video edits.

PrunaAI/pruna-skills

Use when crafting video or motion prompts for any generative model — dramaturgy, camera, physics-safe motion, frame anchors, and clip chaining.

PrunaAI/pruna-skills

Use when someone explicitly wants the fastest, cheapest photo generation — mood boards, bulk panels, or quick iterations — not when controlled photoreal or in-image text is needed.

PrunaAI/pruna-skills

Use when someone wants virtual try-on — dress a person in clothes from reference photos for fashion or ecommerce.

PrunaAI/pruna-skills

Use when installing the full Pruna generative media suite — all guides, tools, and workflows in one package.

PrunaAI/pruna-skills

Use when someone wants a cinematic clip from text or start/end frames — product ads, documentary shots, or dialogue with generated audio. Not for 1080p, imported audio tracks, or talking-head-only hosts.

PrunaAI/pruna-skills

Use when someone wants a polished short clip from text, images, or imported audio — 1080p B-roll, start/end frame animation, or a motion shot with a mixed track. Not for cinematic generated-audio clips or talking-head-only hosts.

PrunaAI/pruna-skills

Use when someone wants to edit an existing video with a text instruction — recolor, restyle, remove or add objects, change environment or lighting, update on-screen text, or apply optional reference-guided product and accessory edits. Not for a new clip from scratch or ffmpeg assembly.

PrunaAI/pruna-skills

Use when someone wants a simple short clip from text or images — quick B-roll, drafts, or start/end frame animation. Not when the brief needs cinematic generation, highest quality, tight lip-sync, or imported audio at 1080p.

相关技能