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…
حول
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
- نعم
- المؤلف
- المؤلف غير متاح
يتطلب عُقدًا مخصصة
- جارٍ قراءة سير العمل
استخدم سير العمل هذا من خلال التعليمات البرمجية
يتم إنشاؤه من مخطط سير العمل والمدخلات عندما يكون ذلك ممكنًا؛ وإلا فتُعرض الأمثلة المخزنة. راجع بيانات الاعتماد ونقاط النهاية قبل تشغيل التعليمات البرمجية، إذ قد تترتب عليها رسوم.
What you need
- Runs on
- Comfy Cloud
- المفتاح
- COMFY_API_KEY
يتطلب خطة 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({
"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)