Skip to main content
TutorialLast updated: January 2025

ComfyUI + Qwen Image Layered

Learn how to integrate this advanced AI model into your ComfyUI workflows. Automate image layer decomposition with our custom nodes and templates.

1. Setup and Installation

Getting started with our custom layer extraction node in ComfyUI requires a few simple steps. Since the model runs on fal.ai cloud servers, no local GPU is needed.

Step 1: Get Your API Key

You will need a fal.ai API key to launch the layer generation process. Sign up at fal.ai and copy your API key from the dashboard.

Step 2: Install ComfyUI

If you have not already, install ComfyUI following their official documentation. Make sure it is running correctly before adding our custom node.

# Clone ComfyUI

git clone https://github.com/comfyanonymous/ComfyUI.git

cd ComfyUI

# Install dependencies

pip install -r requirements.txt

Step 3: Add Custom Node

Create a new Python file in your ComfyUI custom nodes directory. The node connects to fal.ai API for optimal model inference.

File location: ComfyUI/custom_nodes/fal_qwen_image_layered.py

After installing the custom node, restart ComfyUI and you should see the new functionality in the image/analysis category.

Setup Complete

Once the custom node is installed and ComfyUI is restarted, you are ready to process multi-layered images in your workflows.

2. Basic Workflow

Here is the recommended workflow structure for using this advanced segmentation node in ComfyUI.

Workflow Structure

1

Load Image Node

Use the standard Load Image node to import your source image into the workflow.

2

Layer Extraction Node

Connect your image to the layer parsing node and configure parameters like number of layers, guidance scale, and inference steps.

3

Preview and Save Nodes

Add Preview Image nodes for each output layer, and Save Image nodes for export.

Workflow JSON Template

Copy this JSON template and import it into ComfyUI to get started quickly:

{ "nodes": [ { "id": 1, "type": "LoadImage", "inputs": { "image": "your_image.png" } }, { "id": 2, "type": "QwenImageLayered", "inputs": { "image": ["LoadImage", 0], "num_layers": 4, "guidance_scale": 5.0, "inference_steps": 28, "api_key": "your_fal_api_key" } }, { "id": 3, "type": "PreviewImage", "inputs": { "images": ["QwenImageLayered", "layer_1"] } } ] }

3. Parameter Reference

Complete reference for all parameters available in the AI layer extraction ComfyUI node.

ParameterTypeDefaultRangeDescription
num_layersINT41 - 20layers to extract from the image
guidance_scaleFLOAT5.01.0 - 20.0Higher values = more adherence to prompt
inference_stepsINT2810 - 100More steps = higher quality, slower processing
seedINT42AnyRandom seed for reproducibility (-1 = random)
promptSTRINGempty-Optional prompt to guide layer extraction
negative_promptSTRINGempty-Elements to avoid in layer extraction
accelerationSTRINGregularregular / fastUse fast for quicker results
enable_safety_checkerBOOLEANtruetrue / falseEnable content safety filtering

4. LoRA Model Support

The AI layer extraction model supports LoRA (Low-Rank Adaptation) models for custom style fine-tuning. This allows you to apply specific artistic styles to your layer decomposition.

Using LoRA Models

To use a LoRA model, provide the model URL in the lora_model_url parameter. You can adjust the effect strength using lora_strength.

{ "type": "QwenImageLayered", "inputs": { "image": ["LoadImage", 0], "num_layers": 4, "lora_model_url": "https://huggingface.co/your-model.safetensors", "lora_strength": 0.8, "guidance_scale": 5.0, "inference_steps": 28 } }

Recommended LoRA Settings

Style Transferlora_strength: 0.7 - 1.0
Subtle Effectslora_strength: 0.3 - 0.5
Maximum Impactlora_strength: 1.2 - 1.5

5. Troubleshooting

API Key Error

Make sure your fal.ai API key is valid and has sufficient credits. Check that:

  • API key is correctly copied from fal.ai dashboard
  • API key does not contain extra spaces or characters
  • Your fal.ai account has positive credit balance

Poor Layer Quality

If layer quality is not satisfactory, try these adjustments:

  • Increase inference_steps to 50-100 for better quality
  • Lower guidance_scale if layers are too different from original
  • Add a descriptive prompt for specific elements
  • Use higher resolution input images

Slow Processing

To speed up processing:

  • Set acceleration to fast instead of regular
  • Reduce inference_steps to 10-20 for faster results
  • Use fewer num_layers for quicker processing
  • Check your internet connection speed

LoRA Not Working

If LoRA models are not applying correctly:

  • Verify the lora_model_url is a direct download link
  • Ensure the LoRA model is compatible with this vision model
  • Try adjusting lora_strength to a higher value
  • Check that the URL ends with .safetensors or .ckpt

Frequently Asked Questions

How do I install the layer extraction node in ComfyUI?

You can install the extraction tool in ComfyUI by adding our custom node to your ComfyUI custom nodes folder. The node connects directly to the fal.ai API for multi-layer model inference. See the Setup section above for detailed instructions.

What are the system requirements for ComfyUI image layered extraction?

Since the layer generation process runs on fal.ai cloud servers, ComfyUI itself has minimal requirements. You need a working ComfyUI installation and an API key from fal.ai. No local GPU is required for inference.

Can I use LoRA models with the layer decomposition node in ComfyUI?

Yes! The model supports LoRA modifiers for custom style fine-tuning. You can load LoRA weights through the lora_model_url parameter in our ComfyUI custom node. See the LoRA Support section for more details.

What parameters can I adjust in the ComfyUI workflow?

Key parameters include: num_layers (1-20), guidance_scale (1-20), num_inference_steps (10-100), seed, and acceleration mode. You can also set custom prompts and negative prompts. See the Parameter Reference section for complete details.

Related Resources