Extend an image’s borders
Add space around an image and describe what should appear beyond its edges.
ワークフローをダウンロードCloudで試す API ドキュメント
ワークフローの内部
ソーステンプレートの読み取り専用プレビューです。Cloud で開くと、ノードを確認して変更できます。
Loading the graph
Open full-size workflow preview- 作成者
- ComfyUI
コードからこのモデルを呼び出す
以下のリクエストでは、Playground と同じ準備済みグラフと設定を使用します。送信ごとに有料実行が開始される場合があります。結果が不明な送信を自動的に再試行しないでください。
1 API キーを取得 ↗
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({
"3": {
"class_type": "KSampler",
"inputs": {
"cfg": 1,
"denoise": 1,
"latent_image": [
"38",
2
],
"model": [
"39",
0
],
"negative": [
"38",
1
],
"positive": [
"38",
0
],
"sampler_name": "euler",
"scheduler": "normal",
"seed": 164211176398261,
"steps": 20
},
"_meta": {
"title": "KSampler"
}
},
"8": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"3",
0
],
"vae": [
"32",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"9": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI",
"images": [
"8",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"17": {
"class_type": "LoadImage",
"inputs": {
"image": "UPLOADED_image_FILENAME"
},
"_meta": {
"title": "Load Image"
}
},
"23": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"34",
0
],
"text": "beautiful scenery"
},
"_meta": {
"title": "CLIP Text Encode (Positive Prompt)"
}
},
"26": {
"class_type": "FluxGuidance",
"inputs": {
"conditioning": [
"23",
0
],
"guidance": 30
},
"_meta": {
"title": "FluxGuidance"
}
},
"31": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "flux1-fill-dev.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"32": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "ae.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"34": {
"class_type": "DualCLIPLoader",
"inputs": {
"clip_name1": "clip_l.safetensors",
"clip_name2": "t5xxl_fp16.safetensors",
"device": "default",
"type": "flux"
},
"_meta": {
"title": "Load CLIP (Dual)"
}
},
"38": {
"class_type": "InpaintModelConditioning",
"inputs": {
"mask": [
"44",
1
],
"negative": [
"46",
0
],
"noise_mask": False,
"pixels": [
"44",
0
],
"positive": [
"26",
0
],
"vae": [
"32",
0
]
},
"_meta": {
"title": "InpaintModelConditioning"
}
},
"39": {
"class_type": "DifferentialDiffusion",
"inputs": {
"model": [
"31",
0
],
"strength": 1
},
"_meta": {
"title": "Differential Diffusion"
}
},
"44": {
"class_type": "ImagePadForOutpaint",
"inputs": {
"bottom": 400,
"feathering": 24,
"image": [
"17",
0
],
"left": 400,
"right": 400,
"top": 0
},
"_meta": {
"title": "Pad Image for Outpainting"
}
},
"46": {
"class_type": "ConditioningZeroOut",
"inputs": {
"conditioning": [
"23",
0
]
},
"_meta": {
"title": "Conditioning Zero Out"
}
}
})
workflow.set_input("17", "image", client.assets.from_url("https://cdn.jsdelivr.net/gh/Comfy-Org/workflow_templates@90c71fb78b3726392d010ff62a8e79e92d7296ad/input/flux_fill_outpaint_example_input_image.png"))
# 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("9"):
output.to_file(output.name)