Communitygithub.com

PrunaAI/pruna-skills

当用户想要进行虚拟试衣时使用——根据参考照片将服装穿在人物身上,适用于时尚或电商场景。

pruna-skills 是什么?

这个技能(p-image-try-on)让AI代理能够执行虚拟试衣:将参考服装照片精准地穿在人物图像上,同时保留人物身份和服装细节。它支持Pruna和Runware API,使用异步或同步HTTP请求。代理首先锁定人物和服装图片URL,必要时添加简短提示词以消除歧义,然后调用模型。该技能还内嵌了多样化生成、图像提示和Pruna API调用的最佳实践,确保高质量、低成本的生成结果。

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

在你喜欢的 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
pruna-api在任何Pruna或Replicate HTTP调用前使用——凭证、上传/轮询/下载、并行批处理和代理安全。npx skills add PrunaAI/pruna-skills@pruna-api -y

或者一次性安装全套技能:npx skills add PrunaAI/pruna-skills@pruna -y

请遵循每个技能的 Before generating / 构思部分——不要在此处重复指南内容。

代理习惯

在首次回复中,用反引号命名 `p-image-try-on`,确认 PRUNA_API_KEY,然后询问 person_image + garment_images。开启接入 → 当用户沉默时,使用 generation-diversity 澄清接入。当参考资料需要消歧时,使用 提示词构思(动态 + 忠实) 来起草——不要粘贴技能示例。将仅背景/无服装的任务重定向到 p-image-edit。

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

身份和服装来自 person_image + garment_images[]。可选的 prompt 仅用于消歧参考资料——它不会创建新人物或新服装。

应做不应做
首先锁定 person_image 和每个 garment_images[] 的URL;在清晰的平铺图上省略 prompt描述用户未提供的新场景、模特或服装
当参考资料有歧义时:图片1中的绿色T恤和图片2中的裤子(image-prompting 试衣构思)仅凭情绪提示(时尚编辑感觉)或当参考资料不同时复制此技能的详细示例
起草消歧措词前先进行仪式化种子;当存在多个有效映射时变换措辞使用 prompt 进行背景替换——重定向到 p-image-edit
在参考资料有歧义时,在 POST 前展示 prompt(如果需要)无声试衣改变姿势、面部或超出要求的服装

保真度检查(付费前): 输出必须仍然是用户的人物穿着用户的服装。如果 prompt 可能适用于不同的参考集,请重写消歧内容。

何时不使用

改用其他技能:

技能描述安装命令
p-image当用户明确想要最快、最便宜的照片生成时使用——情绪板、批量面板或快速迭代,而非需要受控逼真或图像内文本的场景。npx skills add PrunaAI/pruna-skills@p-image -y
p-image-edit当用户想要编辑现有照片时使用——更换服装或背景、从参考图像合成或应用提示驱动编辑。npx skills add PrunaAI/pruna-skills@p-image-edit -y

定价

每次生成(普通模式和极速模式相同):

  • $0.015 第一件服装
  • $0.008 每增加一件服装

示例:3件服装 → $0.015 + 2 × $0.008 = $0.031。

请求格式

一张 person_image,每件物品一个 garment_images[] 条目(最多11个),可选的 reference_pose。模型会自动分类每件服装——数组顺序无关。混合类别应放在一次调用中。

  • prompt——仅当参考图显示多件服装或穿在模特身上时使用;清晰的平铺图不需要提示。
  • preserve_input_size: true(默认)——输出尺寸遵循人物图像。

Runware字段映射:person → person_image,garment → garment_images[],pose → reference_pose,positivePrompt → prompt,settings.turbo → turbo。

HTTP(curl)

上传图像

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

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

使用每个响应中的 urls.get 作为 input.person_image 和 input.garment_images[]。可选:reference_pose。

创建(异步——推荐)

curl -X POST 'https://api.pruna.ai/v1/predictions' \
  -H 'Content-Type: application/json' \
  -H "apikey: ${PRUNA_API_KEY}" \
  -H 'Model: p-image-try-on' \
  -d '{
    "input": {
      "person_image": "https://api.pruna.ai/v1/files/PERSON_FILE_ID",
      "garment_images": ["https://api.pruna.ai/v1/files/GARMENT_FILE_ID"]
    }
  }'

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

在编写提示前完成 generation-diversity 中的随机种子仪式——不要将仪式字符串作为 API seed 传递。

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

curl -X POST 'https://api.pruna.ai/v1/predictions' \
  -H 'Content-Type: application/json' \
  -H "apikey: ${PRUNA_API_KEY}" \
  -H 'Model: p-image-try-on' \
  -H 'Try-Sync: true' \
  -d '{
    "input": {
      "person_image": "https://api.pruna.ai/v1/files/PERSON_FILE_ID",
      "garment_images": ["https://api.pruna.ai/v1/files/GARMENT_FILE_ID"]
    }
  }'

扩展输入(极速 + 姿势 + 提示)

curl -X POST 'https://api.pruna.ai/v1/predictions' \
  -H 'Content-Type: application/json' \
  -H "apikey: ${PRUNA_API_KEY}" \
  -H 'Model: p-image-try-on' \
  -d '{
    "input": {
      "person_image": "https://api.pruna.ai/v1/files/PERSON_FILE_ID",
      "garment_images": [
        "https://api.pruna.ai/v1/files/MULTI_GARMENT_SHOT_ID",
        "https://api.pruna.ai/v1/files/BOTTOM_ID"
      ],
      "reference_pose": "https://api.pruna.ai/v1/files/POSE_REF_ID",
      "prompt": "the green t-shirt from image 1 and the trousers from image 2",
      "turbo": true,
      "output_format": "jpg",
      "output_quality": 95,
      "preserve_input_size": true
    }
  }'

生成前

  1. 完成前置条件指南阅读顺序(generation-diversity → image-prompting 试衣构思)。
  2. 仪式化种子 → 起草可选的动态 + 忠实消歧 prompt(上节)→ 确认 person_image、garment_images(最终版≤6;7–8通常成功;9–11可能丢弃最后几件)、以及可选的 turbo / reference_pose / prompt。
  3. Pruna 说明: 每个身体部位一件物品(袜子+鞋子→通常鞋子胜出)。turbo(约2.5–3.5秒)默认关闭——对于超过约4件服装的最终版不推荐。全身或四分之三人物裁剪效果最好。从 garment_images[] 中排除手套、连指手套、手持道具、口袋方巾、吊裤带、胸针。

必需输入

  • person_image(字符串URL)
  • garment_images(字符串URL数组,最多 11 个)

常用可选字段

  • seed、output_format(webp / jpg / png,默认 jpg)、output_quality(0–100,默认 95)
  • preserve_input_size(布尔值,默认 true)
  • turbo(布尔值,默认 false)
  • reference_pose(人物图像URL)
  • prompt(实验性——用于消歧非平铺/多服装参考)

典型后续步骤

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

技能描述安装命令
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-avatar当用户想要一个人对着镜头念稿时使用——口型同步主持人、发言人或有叙述功能的头像,只需一张照片。npx skills add PrunaAI/pruna-skills@p-video-avatar -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 wants to edit an existing photo — change outfits or backgrounds, compose from reference images, or apply prompt-driven edits.

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 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.

相关技能