Remove Background: Qwen Image 2.1
Remove image backgrounds with Qwen Image 2.1, which natively supports 2K output and RGBA transparency for direct transparent results. It takes 1 input image…
ワークフローをダウンロードCloudで試す API ドキュメント
概要
Remove image backgrounds with Qwen Image 2.1, which natively supports 2K output and RGBA transparency for direct transparent results. It takes 1 input image…
入力するもの
- ワークフローを読み込み中
ComfyUI で実行できます。 このワークフローはこのページでは実行できません。ダウンロードしてComfyUIで開いてください。
ワークフローをダウンロードこのワークフローにはまだサンプル出力がありません。
ワークフローの内部
ノードグラフの読み取り専用プレビューです。ノードを編集するには、Comfy Cloudで開くかダウンロードしてください。
Loading the graph
Open full-size workflow previewこのワークフロー内のファイル
- Comfy Cloud
- はい
- 作成者
- 著者は利用できません
カスタムノードが必要です
- ワークフローを読み込み中
コードからこのワークフローを使用する
可能な場合はワークフローグラフと入力から生成されます。それ以外の場合は保存された例が表示されます。料金が発生する場合があるため、コードを実行する前に認証情報とエンドポイントを確認してください。
1 API キーを取得 ↗
What you need
- Runs on
- Comfy Cloud
- キー
- COMFY_API_KEY
有料の Cloud プランとクレジットが必要です。
API JSONをダウンロードAPI ドキュメント ↗
# 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({
"461": {
"class_type": "SaveImageAdvanced",
"inputs": {
"filename_prefix": "Qwen_image_2.1",
"format": "png",
"format.bit_depth": "8-bit",
"format.input_color_space": "sRGB",
"images": [
"459:457",
0
]
},
"_meta": {
"title": "Save Image (Advanced)"
}
},
"470": {
"class_type": "LoadImage",
"inputs": {
"image": "angry_broccoli.png"
},
"_meta": {
"title": "Load Image"
}
},
"472": {
"class_type": "ImageCompare",
"inputs": {
"compare_view": None,
"image_a": [
"470",
0
],
"image_b": [
"461",
0
]
},
"_meta": {
"title": "Compare Images"
}
},
"459:451": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "qwen_image_2.1_int8_convrot.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"459:453": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "qwen3vl_8b_int8_convrot.safetensors",
"device": "default",
"type": "qwen_image"
},
"_meta": {
"title": "Load CLIP"
}
},
"459:454": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "qwen_image_2.1_vae_bf16.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"459:456": {
"class_type": "EmptyLatentImage",
"inputs": {
"batch_size": 1,
"height": 1024,
"width": 1024
},
"_meta": {
"title": "Empty Latent Image"
}
},
"459:457": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"459:458",
0
],
"vae": [
"459:454",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"459:458": {
"class_type": "KSampler",
"inputs": {
"cfg": 1,
"denoise": 1,
"latent_image": [
"459:468",
0
],
"model": [
"459:469",
0
],
"negative": [
"459:474",
1
],
"positive": [
"459:474",
0
],
"sampler_name": "euler",
"scheduler": "simple",
"seed": 733114857276099,
"steps": 25
},
"_meta": {
"title": "KSampler"
}
},
"459:468": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"459:474",
2
],
"on_true": [
"459:456",
0
],
"switch": False
},
"_meta": {
"title": "If/Else Switch"
}
},
"459:469": {
"class_type": "QwenImage21Cache",
"inputs": {
"device": "auto",
"dtype": "default",
"model": [
"459:451",
0
]
},
"_meta": {
"title": "Qwen Image 2.1 Cache"
}
},
"459:474": {
"class_type": "TextEncodeQwenImage21",
"inputs": {
"clip": [
"459:453",
0
],
"images.image_1": [
"470",
0
],
"negative_prompt": "",
"prompt": "Remove the background, and output a PNG image",
"resolution": 0,
"vae": [
"459:454",
0
]
},
"_meta": {
"title": "Text Encode Qwen Image 2.1"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)