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…
Hakkında
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…
Sağladıklarınız
- İş akışı okunuyor
ComfyUI'da çalışır. Bu iş akışı bu sayfada çalışamaz. İndirin ve ComfyUI'da açın.
İş Akışını İndirBu iş akışı için henüz örnek çıktı yok.
İş akışının içinde
Düğüm grafiğinin salt okunur önizlemesi. Düğümleri düzenlemek için bunu Comfy Cloud'da açın veya indirin.
Loading the graph
Open full-size workflow previewBu iş akışındaki dosyalar
- Comfy Cloud
- Evet
- Yazar
- Yazar kullanılamıyor
Özel düğümler gerektirir
- İş akışı okunuyor
Bu iş akışını koddan kullanın
Mümkün olduğunda iş akışı grafiği ve girdilerden oluşturulur; aksi hâlde kayıtlı örnekler gösterilir. Ücret doğurabilecek kodu çalıştırmadan önce kimlik bilgilerini ve uç noktaları gözden geçirin.
What you need
- Runs on
- Comfy Cloud
- Anahtar
- COMFY_API_KEY
Ü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({
"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)