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…
Acerca de
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…
Lo que proporcionas
- Leyendo el flujo de trabajo
Se ejecuta en ComfyUI. Este flujo de trabajo no puede ejecutarse en esta página. Descárgalo y ábrelo en ComfyUI.
Descargar flujo de trabajoAún no hay resultados de muestra para este flujo de trabajo.
Dentro del flujo de trabajo
Una vista previa de solo lectura del gráfico de nodos. Ábrelo en Comfy Cloud o descárgalo para editar los nodos.
Loading the graph
Open full-size workflow previewArchivos de este flujo de trabajo
- Comfy Cloud
- Sí
- Autor
- Autor no disponible
Requiere nodos personalizados
- Leyendo el flujo de trabajo
Usa este flujo de trabajo desde código
Se genera a partir del gráfico y las entradas del flujo de trabajo cuando es posible; de lo contrario, se muestran ejemplos almacenados. Revisa las credenciales y los endpoints antes de ejecutar el código, ya que puede generar cargos.
What you need
- Runs on
- Comfy Cloud
- Clave
- COMFY_API_KEY
Requiere un plan de pago de Cloud y créditos.
# 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)