Communitygithub.com

PrunaAI/pruna-skills

用於編輯現有照片 — 更換服裝或背景、從參考圖像合成,或根據提示進行修改。

pruna-skills 是什麼?

此技能專為 AI 代理設計,用於執行手術刀般精確的照片編輯任務,例如更換服裝、背景,或根據參考圖像進行合成。它支援 Pruna API 的非同步 HTTP 呼叫,並提供詳細的提示工程指南,確保編輯僅針對使用者要求的範圍,同時保留其他所有元素。此技能整合了 `generation-diversity` 的隨機種子儀式和 `image-prompting` 的編輯提示技巧,以提高生成品質和忠實度。包含上傳參考圖像、確認編輯提示、指定長寬比和 Turbo 模式等步驟,並在編輯完成後提供後續處理建議,如放大或生成影片。

相容平台~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,然後詢問來源照片(以及編輯簡要)。必要時開啟 intake → generation-diversity 的澄清 intake。使用提示工程(動態且忠實) 來草擬編輯。當任務是從商品照進行服裝試穿時,導向 p-image-try-on。

提示工程(動態且忠實)

編輯提示是手術刀般精確且鎖定要求的。只更改使用者要求的內容;保持其他一切完全相同。多樣性適用於如何表達更改 — 而不是憑空發明一個新場景。

應做不應做
公式:更改 [特定事物]。保持 [身分/姿勢/光線/背景] 完全相同。 (image-prompting 編輯技巧)讓它變得更好 / 僅憑感覺改寫而忽略簡要
列出使用者要求的每一個必須保留項目(臉部、服裝、姿勢、背景、產品)省略保持子句並希望模型能自動保留它們
在草擬前,從 generation-diversity 取得新的儀式種子;當簡要允許時,變化自由措辭(材質、色碼、運鏡細節)當使用者要求其他內容時,仍複製此技能的範例(柔和的漸層)
在合成時指出參考來源:臉部來自圖像 1,服裝來自圖像 2模糊地說結合這些圖像
當措辭尚未鎖定時,在 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": "將背景更改為柔和的漸層,保持主體完全相同",
      "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": "將背景更改為柔和的漸層,保持主體完全相同",
      "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.

相關技能