Capybara:圖像編輯
上傳圖像或影片並輸入文字指令。使用Capybara模型產生編輯後的輸出,適用於風格更改、物件替換或時間調整等任務。
下載工作流程在 Cloud 中試用 API 文件
關於
Capybara:圖像編輯工作流程是一套利用 AI 進行進階圖像編輯的強大工具。流程核心採用 Capybara 模型,能根據文字指令解讀並修改影像或影片。不論是想變換影像風格、替換場景物件,或調整畫面時間(如日夜變換),只需簡單輸入即可完成。流程從 LoadImage 節點開始,讓使用者上傳影像或影片,接著由專用節點(4f4ddf39-1508-4d34-a35c-ff10e6ce995b)根據 Capybara 模型執行指定編輯,最後用 SaveImage 節點儲存結果。
技術上,此流程可處理多種解析度與長寬比,靈活適應不同專案需求。Capybara 模型可供本地下載使用,建議設定 50 步驟以獲得高品質結果。此流程特別適合需要精細且多元圖像編輯的創作者與專業人士,無需繁瑣手動調整即可完成精準修改。
您提供的內容
- 正在讀取工作流程
在 ComfyUI 中執行。 此工作流程無法在此頁面上執行。請在已載入所有內容的 Comfy Cloud 中開啟,或下載到您自己的 ComfyUI。
在 Cloud 中試用範例
工作流程內部
節點圖的唯讀預覽。請在 Comfy Cloud 中開啟,或下載後編輯節點。
從程式碼使用此工作流程
可行時會根據工作流程圖和輸入內容產生;否則會顯示儲存的範例。執行可能產生費用的程式碼前,請檢查認證資訊和端點。
1 取得 API 金鑰 ↗
What you need
- Runs on
- Comfy Cloud
- 金鑰
- COMFY_API_KEY
需要付費 Cloud 方案與點數。
下載 API JSONAPI 文件 ↗
# Python 3.10+: pip install comfy-sdk==0.4.0
import os
from comfy_sdk import Comfy
api_key = os.environ.get("COMFY_API_KEY", "").strip()
if not api_key: raise RuntimeError("Set COMFY_API_KEY")
os.environ.setdefault("COMFY_BASE_URL", "https://cloud.comfy.org")
client = Comfy(api_key=api_key)
workflow = client.workflows.from_json({
"80": {
"class_type": "LoadImage",
"inputs": {
"image": "wind_woman.png"
},
"_meta": {
"title": "Load Image"
}
},
"102": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "Capybara_v0.1",
"images": [
"103:8",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"103:10": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "hunyuanvideo15_vae_fp16.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"103:105": {
"class_type": "ResizeImageMaskNode",
"inputs": {
"input": [
"80",
0
],
"resize_type": "scale dimensions",
"resize_type.crop": "center",
"resize_type.height": 1024,
"resize_type.width": 1024,
"scale_method": "lanczos"
},
"_meta": {
"title": "Resize Image/Mask"
}
},
"103:11": {
"class_type": "DualCLIPLoader",
"inputs": {
"clip_name1": "qwen_2.5_vl_7b.safetensors",
"clip_name2": "byt5_small_glyphxl_fp16.safetensors",
"device": "default",
"type": "hunyuan_video_15"
},
"_meta": {
"title": "Load CLIP (Dual)"
}
},
"103:12": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "capybara_v0.1.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"103:13": {
"class_type": "SamplerCustomAdvanced",
"inputs": {
"guider": [
"103:91",
0
],
"latent_image": [
"103:78",
2
],
"noise": [
"103:25",
0
],
"sampler": [
"103:16",
0
],
"sigmas": [
"103:17",
0
]
},
"_meta": {
"title": "SamplerCustomAdvanced"
}
},
"103:16": {
"class_type": "KSamplerSelect",
"inputs": {
"sampler_name": "euler"
},
"_meta": {
"title": "KSamplerSelect"
}
},
"103:17": {
"class_type": "BasicScheduler",
"inputs": {
"denoise": 1,
"model": [
"103:12",
0
],
"scheduler": "simple",
"steps": 20
},
"_meta": {
"title": "BasicScheduler"
}
},
"103:25": {
"class_type": "RandomNoise",
"inputs": {
"noise_seed": 1044901887090653
},
"_meta": {
"title": "RandomNoise"
}
},
"103:44": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"103:11",
0
],
"text": "Keep the characters and fluttering costumes unchanged, replace the indoor scene with an outdoor grassland setting"
},
"_meta": {
"title": "CLIP Text Encode (Positive Prompt)"
}
},
"103:67": {
"class_type": "ModelSamplingSD3",
"inputs": {
"model": [
"103:12",
0
],
"shift": 7
},
"_meta": {
"title": "ModelSamplingSD3"
}
},
"103:78": {
"class_type": "HunyuanVideo15ImageToVideo",
"inputs": {
"batch_size": 1,
"clip_vision_output": [
"103:79",
0
],
"height": [
"103:98",
1
],
"length": [
"103:98",
2
],
"negative": [
"103:93",
0
],
"positive": [
"103:44",
0
],
"start_image": [
"103:105",
0
],
"vae": [
"103:10",
0
],
"width": [
"103:98",
0
]
},
"_meta": {
"title": "HunyuanVideo15ImageToVideo"
}
},
"103:79": {
"class_type": "CLIPVisionEncode",
"inputs": {
"clip_vision": [
"103:81",
0
],
"crop": "none",
"image": [
"103:105",
0
]
},
"_meta": {
"title": "CLIP Vision Encode"
}
},
"103:8": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"103:13",
0
],
"vae": [
"103:10",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"103:81": {
"class_type": "CLIPVisionLoader",
"inputs": {
"clip_name": "sigclip_vision_patch14_384.safetensors"
},
"_meta": {
"title": "Load CLIP Vision"
}
},
"103:91": {
"class_type": "CFGGuider",
"inputs": {
"cfg": 6,
"model": [
"103:67",
0
],
"negative": [
"103:78",
1
],
"positive": [
"103:78",
0
]
},
"_meta": {
"title": "CFG Guider"
}
},
"103:93": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"103:11",
0
],
"text": "blurry, low quality, distorted, ugly, watermark, text"
},
"_meta": {
"title": "CLIP Text Encode (Negative Prompt)"
}
},
"103:98": {
"class_type": "GetImageSize",
"inputs": {
"image": [
"103:105",
0
]
},
"_meta": {
"title": "Get Image Size"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)問答
Capybara 模型可進行風格變換、物件替換、調整時間(如白天/夜晚)等多種編輯。
建議在 ComfyUI 中將步數設為 50(預設為 20),如流程文件所建議,可提升品質。
可以,流程支援圖片與影片輸入,可逐格編輯影片。
可以,解析度與長寬比可依 Capybara 解析度設定表調整。