Capybara: Image Edit
Upload an image or video and input a text instruction. Generate an edited output using the Capybara model for tasks like style changes, object replacement, or time-of-day adjustments.
About
The Capybara: Image Edit workflow is a powerful tool designed to facilitate advanced image editing tasks using AI. At its core, this workflow leverages the Capybara model, which is adept at interpreting text instructions to modify images or videos. Whether you want to change the style of an image, replace objects, or adjust the time of day depicted, this workflow makes it possible with just a few simple inputs.
The process begins with the LoadImage node, where users upload their desired image or video. Instructions are then processed by a specialized node (4f4ddf39-1508-4d34-a35c-ff10e6ce995b), which applies the specified edits using the Capybara model. The final output is saved using the SaveImage node.
Technically, this workflow is designed to handle various resolutions and aspect ratios, ensuring flexibility and adaptability for different projects. The Capybara model, available in a downloadable format for local users, operates efficiently with a recommended configuration of 50 steps for high-quality results. This workflow is particularly useful for creatives and professionals who require precise and nuanced image edits without the need for extensive manual adjustments.
What you provide
- Reading the workflow
Runs in ComfyUI. This workflow can't run on this page. Open it in Comfy Cloud with everything loaded, or download it for your own ComfyUI.
Try in CloudInside the workflow
A read-only preview of the node graph. Open it in Comfy Cloud or download it to edit the nodes.
Loading the graph
Open full-size workflow preview- Author
- ComfyUI
Requires custom nodes
- Reading the workflow
Use this workflow from code
Generated from the workflow graph and inputs when possible; stored examples are shown otherwise. Review credentials and endpoints before running code, which may incur charges.
What you need
- Runs on
- Comfy Cloud
- Key
- COMFY_API_KEY
Needs a paid Cloud plan and credits.
# 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)Questions & answers
The Capybara model can perform style changes, object replacements, and time-of-day adjustments, among other edits.
For better quality, use 50 steps instead of the default 20 steps in ComfyUI, as recommended in the workflow documentation.
Yes, the workflow supports both image and video inputs, allowing for frame-by-frame video editing.
Yes, you can configure the resolution and aspect ratio according to the Capybara Resolution Configuration table provided in the workflow.