Upscale an illustration
Enlarge artwork while preserving its lines, texture, and style.
İş Akışını İndirCloud'da deneyin API belgeleri
İş akışının içinde
Kaynak şablonun salt okunur önizlemesi. Düğümleri incelemek ve değişiklik yapmak için Cloud'da açın.
Loading the graph
Open full-size workflow preview- Yazar
- ComfyUI
Bu modeli kodunuzdan çağırın
Aşağıdaki istek, Playground ile aynı hazırlanmış grafiği ve ayarları kullanır. Her gönderim ücretli bir çalıştırma başlatabilir; sonucu bilinmeyen bir gönderimi otomatik olarak yeniden denemeyin.
1 API anahtarı al ↗
What you need
- Runs on
- Comfy Cloud
- Anahtar
- COMFY_API_KEY
- Dosyalarınız
- Kod tarafından URL'lerinden yüklenir
Ücretli bir Cloud planı ve kredi gerektirir.
# 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({
"1": {
"class_type": "TopazImageEnhance",
"inputs": {
"color_preservation": True,
"creativity": 2,
"crop_to_fill": False,
"face_enhancement": False,
"face_enhancement_creativity": 0,
"face_enhancement_strength": 1,
"face_preservation": False,
"image": [
"5",
0
],
"model": "Reimagine",
"output_height": [
"3",
1
],
"output_width": [
"3",
0
],
"prompt": "",
"subject_detection": "All"
},
"_meta": {
"title": "Topaz Image Enhance (Legacy)"
}
},
"2": {
"class_type": "ImageScaleBy",
"inputs": {
"image": [
"5",
0
],
"scale_by": 4,
"upscale_method": "lanczos"
},
"_meta": {
"title": "Upscale Image By"
}
},
"3": {
"class_type": "GetImageSize",
"inputs": {
"image": [
"2",
0
]
},
"_meta": {
"title": "Get Image Size"
}
},
"4": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "",
"images": [
"1",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"5": {
"class_type": "LoadImage",
"inputs": {
"image": "UPLOADED_image_FILENAME"
},
"_meta": {
"title": "Load Image"
}
}
})
workflow.set_input("5", "image", client.assets.from_url("https://cdn.jsdelivr.net/gh/Comfy-Org/workflow_templates@90c71fb78b3726392d010ff62a8e79e92d7296ad/input/silent_sanctuary.jpg"))
# 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("4"):
output.to_file(output.name)