圖像放大
此應用程式使用最佳的開源放大模型 SeedVR2 來放大你的影像。
工作流程內部
來源範本的唯讀預覽。請在 Cloud 中開啟,以探索節點並進行變更。
Loading the graph
Open full-size workflow preview- 輸出
- 圖片
- 作者
- Rob
從您的程式碼呼叫此模型
以下請求使用與 Playground 相同的已準備節點圖和設定。每次提交都可能啟動付費執行;若提交結果不明,請勿自動重試提交。
What you need
- Runs on
- Comfy Cloud
- 金鑰
- COMFY_API_KEY
- 您的檔案
- 由程式碼透過其 URL 上傳
需要付費 Cloud 方案與點數。
# 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({
"24": {
"class_type": "LoadImage",
"inputs": {
"image": "UPLOADED_image_FILENAME"
},
"_meta": {
"title": "Load Image"
}
},
"45": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI-upscaled",
"images": [
"47:27",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"47:21": {
"class_type": "GetImageSize",
"inputs": {
"image": [
"24",
0
]
},
"_meta": {
"title": "Get Image Size"
}
},
"47:22": {
"class_type": "SeedVR2LoadVAEModel",
"inputs": {
"cache_model": False,
"decode_tile_overlap": 128,
"decode_tile_size": 1024,
"decode_tiled": True,
"device": "cuda:0",
"encode_tile_overlap": 128,
"encode_tile_size": 1024,
"encode_tiled": True,
"model": "ema_vae_fp16.safetensors",
"offload_device": "none",
"tile_debug": "false"
},
"_meta": {
"title": "SeedVR2 (Down)Load VAE Model"
}
},
"47:25": {
"class_type": "SimpleMath+",
"inputs": {
"a": [
"47:49",
0
],
"b": [
"47:30",
0
],
"value": "a*b"
},
"_meta": {
"title": "Upscale to Shortest Edge (pixels)"
}
},
"47:27": {
"class_type": "SeedVR2VideoUpscaler",
"inputs": {
"batch_size": 1,
"color_correction": "lab",
"dit": [
"47:28",
0
],
"enable_debug": False,
"image": [
"24",
0
],
"input_noise_scale": 0.001,
"latent_noise_scale": 0.001,
"max_resolution": 0,
"offload_device": "cpu",
"prepend_frames": 0,
"resolution": [
"47:25",
0
],
"seed": 1990556266,
"temporal_overlap": 0,
"uniform_batch_size": False,
"vae": [
"47:22",
0
]
},
"_meta": {
"title": "SeedVR2 Video Upscaler (v2.5.24)"
}
},
"47:28": {
"class_type": "SeedVR2LoadDiTModel",
"inputs": {
"attention_mode": "sdpa",
"blocks_to_swap": 0,
"cache_model": False,
"device": "cuda:0",
"model": "seedvr2_ema_7b_fp16.safetensors",
"offload_device": "cpu",
"swap_io_components": False
},
"_meta": {
"title": "SeedVR2 (Down)Load DiT Model"
}
},
"47:30": {
"class_type": "PrimitiveFloat",
"inputs": {
"value": 2
},
"_meta": {
"title": "Upscale Factor"
}
},
"47:40": {
"class_type": "ImpactCompare",
"inputs": {
"a": [
"47:21",
0
],
"b": [
"47:21",
1
],
"cmp": "a <= b"
},
"_meta": {
"title": "ImpactCompare"
}
},
"47:49": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"47:21",
1
],
"on_true": [
"47:21",
0
],
"switch": [
"47:40",
0
]
},
"_meta": {
"title": "If/Else Switch"
}
}
})
workflow.set_input("24", "image", client.assets.from_url("https://comfy.org/catalog-media/8a5038e4-6157-467f-9df5-cbb3433c67d8/229a0369-432c-4f99-898b-60f80fe2b2d5"))
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)
for output in job.get_outputs("45"):
output.to_file(output.name)試試範例
關於此工作流程
此 ComfyUI 工作流程利用開源 SeedVR2 放大模型,進行高品質單張圖像超解析放大。流程簡潔、適合生產環境:LoadImage 載入原始圖像,SeedVR2 Upscale 節點(c35dd4ba-0fe3-47d6-afce-1c56d9fe5beb)提升解析度並重建細節,SaveImage 將結果寫入磁碟。此流程專注於放大,無需提示詞、採樣器或擴散步驟——速度快、可重複、易於調整。
SeedVR2 會學習高頻細節的映射,於高解析度下重建細節,同時保留原始構圖與色彩,提升銳利度與質感。實際操作時,載入圖像、選擇 SeedVR2 節點提供的放大倍率(常見為 2x 或 4x,依節點設定),排入作業,取得輸出。非常適合印刷資產準備、渲染放大,或在不改變內容的前提下優化 AI 生成圖像。
問答
不會。它使用學習式放大器(SeedVR2)在不使用提示詞或 diffusion 步驟的情況下,以更高解析度重建細節。構圖與色彩會被保留,但可能會出現輕微銳化與紋理回復。
可用倍率取決於此工作流程中 SeedVR2 Upscale 節點的設定(常見為 2x 或 4x)。打開節點即可查看選項。若需要非常大的輸出,建議跑兩次 2x。
SaveImage 會依你在節點中設定的檔名前綴,將檔案寫入 ComfyUI/output 目錄。點擊 Queue Prompt 後請到該資料夾查看。
請嘗試降低倍率、關閉其他占用 GPU 的應用程式,或分兩次放大(例如 2x 再 2x)。建議使用 GPU;CPU 也能執行但會明顯較慢。