Upscale an illustration
Enlarge artwork while preserving its lines, texture, and style.
Download WorkflowTry in Cloud API documentation
Inside the workflow
A read-only preview of the source template. Open it in Cloud to explore the nodes and make changes.
Loading the graph
Open full-size workflow preview- Author
- ComfyUI
Call this model from your code
The request below uses the same prepared graph and settings as the Playground. Each submission can start a paid run; do not automatically retry a submission whose outcome is unknown.
1 Get API key ↗
What you need
- Runs on
- Comfy Cloud
- Key
- COMFY_API_KEY
- Your files
- Uploaded by the code from their urls
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({
"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)