← Back to Skills Marketplace
navygo

Alibaba Cloud Bailian Qwen Image 2.0 image generation. Supports text-to-image and image-to-image (reference image + text). For product promotion image generation, e-commerce image editing, marketing material creation. Provides Python API, CLI tool, and ComfyUI custom nodes.

by navygo · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ⚠ suspicious
398
Downloads
1
Stars
2
Active Installs
2
Versions
Install in OpenClaw
/install bailian-image-gen
Description
Alibaba Cloud Bailian Qwen Image 2.0 image generation. Supports text-to-image and image-to-image (reference image + text). For product promotion image genera...
README (SKILL.md)

Alibaba Cloud Bailian Image Generation

Based on Alibaba Cloud Bailian platform's qwen-image-2.0 model, providing high-quality text-to-image and image-to-image capabilities.

Features

  • Text-to-Image - Generate high-quality images from text descriptions
  • Image-to-Image - Generate new images from reference image + text description
  • ComfyUI Integration - Complete ComfyUI custom nodes
  • Auto Compression - Automatically handle reference image size limits
  • Synchronous Calls - No async task waiting, instant results

Use Cases

  • C-end App product promotion image generation
  • E-commerce product image style transfer and background replacement
  • Marketing material batch generation
  • Creative image editing

Quick Start

Environment Setup

  1. Install dependencies:

    pip install requests Pillow
    
  2. Configure API Key (two methods):

    Method 1: .env file (recommended)

    cp .env.example .env
    # Edit .env file
    DASHSCOPE_API_KEY=your-api-key-here
    

    Method 2: Environment variable

    export DASHSCOPE_API_KEY=your-api-key
    

    Get API Key from bailian.console.aliyun.com

Command Line Usage

# Text-to-Image
python scripts/bailian_image_gen.py --mode t2i --prompt "A cute orange cat, high quality" --output cat.png

# Image-to-Image
python scripts/bailian_image_gen.py --mode i2i --prompt "Modern minimalist living room scene, warm lighting" --reference-image product.jpg --output result.png

Python API

from scripts.bailian_image_gen import QwenImageGenerator

# Initialize
client = QwenImageGenerator()

# Text-to-Image
result = client.text_to_image(
    prompt="A cute orange cat, high quality",
    size="1024*1024"
)
url = client.extract_image_url(result)
client.download_image(url, "output.png")

# Image-to-Image
result = client.image_to_image(
    prompt="Modern minimalist living room scene, warm lighting",
    reference_image_path="product.jpg"
)
url = client.extract_image_url(result)
client.download_image(url, "output.png")

ComfyUI Integration

Install Nodes

  1. Copy files to ComfyUI:

    cp scripts/bailian_image_gen.py /path/to/ComfyUI/custom_nodes/
    cp scripts/comfyui_bailian_node.py /path/to/ComfyUI/custom_nodes/
    
  2. Configure API Key in ComfyUI directory:

    echo "DASHSCOPE_API_KEY=your-api-key" > /path/to/ComfyUI/.env
    
  3. Restart ComfyUI

Available Nodes

Search "Bailian" in ComfyUI to find these nodes:

BailianText2Image

  • Inputs: prompt (STRING), size (COMBO), seed (INT)
  • Output: image (IMAGE)

BailianImage2Image

  • Inputs: image (IMAGE), prompt (STRING), size (COMBO), seed (INT)
  • Output: image (IMAGE)

Workflow Example

Import assets/comfyui_workflow.json for product promotion image generation example.

Typical workflow:

[Load Image] --> [BailianImage2Image] --> [Save Image]
                      ^
                prompt: "Modern minimalist living room, warm lighting"

Parameters

Parameter Type Description Default
--mode string t2i=text-to-image, i2i=image-to-image Required
--prompt string Prompt text Required
--reference-image string Reference image path (i2i mode) None
--size string Image size 1024*1024
--seed int Random seed Random
--output string Output path Required

Supported Image Sizes

  • 1024*1024 - Square (recommended)
  • 1024*768 - Landscape
  • 768*1024 - Portrait
  • 2048*2048 - High resolution

Prompt Tips

Product Promotion Template

[Product] placed in [Scene], [Style], [Lighting], [Quality requirements]

Examples:

  • "Smartwatch placed on minimalist white marble desktop, Nordic minimalist style, natural light, product photography quality"
  • "Sneakers placed on wooden floor, city skyline background, fashion magazine style, soft side lighting"
  • "Cosmetics placed on dressing table, surrounded by flowers and perfume bottles, luxury style, warm lighting"

File Structure

bailian-image-gen/
├── .env.example              # API Key config example
├── README.md                 # Detailed documentation
├── requirements.txt          # Dependencies
├── SKILL.md                  # This file
├── assets/
│   └── comfyui_workflow.json # ComfyUI workflow example
└── scripts/
    ├── bailian_image_gen.py      # Core script
    └── comfyui_bailian_node.py   # ComfyUI nodes

Notes

  1. API Key - Requires Alibaba Cloud Bailian platform account and API Key
  2. Image Compression - Reference images are automatically compressed to meet API limits
  3. Network Requirements - Requires access to Alibaba Cloud dashscope service
  4. Synchronous Calls - qwen-image-2.0 uses synchronous calls, no async task waiting

Error Handling

Common errors and solutions:

Error Cause Solution
API Key error Not configured or incorrect Check .env file or environment variable
Image too large Reference image exceeds limit Script auto-compresses, if still fails use smaller image
Network error Cannot access Alibaba Cloud Check network connection

References

  • [Alibaba Cloud Bailian Console]
  • [OpenClaw Documentation]
  • [ComfyUI GitHub]

Author

@navygo

Usage Guidance
Before installing: 1) Expect to provide an Alibaba Bailian 'DASHSCOPE_API_KEY' — the skill metadata did not declare this, so do not paste other secrets into .env files. 2) Verify dashscope.aliyuncs.com is the expected official endpoint for your account; prefer official SDKs or vendor docs if unsure. 3) The ComfyUI node imports torch/numpy — ComfyUI normally provides those, but ensure your environment satisfies runtime dependencies. 4) The scripts will load a .env file from parent directories and set all found keys into the process environment; check those .env files for unwanted secrets before copying files into ComfyUI. 5) Review the two Python files yourself (they are short and readable) and, if possible, run them in an isolated environment (container or VM) and avoid storing long-lived secrets in world-readable files. 6) Because the package source/homepage is unknown, prefer obtaining client code from an official Alibaba/console-backed SDK or an identified, trusted repository if you need production use.
Capability Analysis
Type: OpenClaw Skill Name: bailian-image-gen Version: 1.0.1 The skill bundle provides a legitimate integration with Alibaba Cloud's Bailian Qwen Image 2.0 platform for image generation. The core logic in `scripts/bailian_image_gen.py` and `scripts/comfyui_bailian_node.py` focuses on interacting with the official DashScope API (dashscope.aliyuncs.com), handling image compression, and providing ComfyUI nodes. No evidence of data exfiltration, malicious execution, or prompt injection was found.
Capability Assessment
Purpose & Capability
The skill claims no required environment or credentials in its registry metadata, but both SKILL.md and the Python code require an Alibaba 'DASHSCOPE_API_KEY' (Bearer auth) and make network calls to dashscope.aliyuncs.com. The presence of ComfyUI node code also depends on torch/numpy at runtime but these are not declared in requirements or installation instructions. The required credential and runtime libs are proportional to image-generation, but the metadata omission is incoherent.
Instruction Scope
SKILL.md instructions align with the stated purpose (text2image and image2image via Bailian). It instructs copying files into ComfyUI and storing the DASHSCOPE_API_KEY in a .env file (or exporting it). The instructions cause secrets to be written to disk (.env) and advise copying into ComfyUI/custom_nodes where code will run automatically — this is expected but should be noted. The docs do not mention installing torch/numpy which the ComfyUI nodes import (ComfyUI typically provides them, but it's not documented here).
Install Mechanism
No remote install downloads or executable installers; it's an instruction-only skill with local Python scripts and assets. Dependencies listed are requests and Pillow (in requirements.txt and SKILL.md). There are no external URLs used to pull arbitrary code at install time.
Credentials
The code requires DASHSCOPE_API_KEY but the skill metadata declares no required env vars or primary credential — a clear mismatch. Both scripts load .env files from parent directories and set environment variables globally (os.environ.setdefault / os.environ[key] = value), which may unintentionally import unrelated secrets present in those .env files. The number and sensitivity of env vars used (API key) is reasonable for the feature, but the metadata omission and broad .env loading are concerning.
Persistence & Privilege
The skill is not always-enabled and does not request elevated or platform-wide privileges. It writes temporary files during i2i processing and SKILL.md instructs users to create a .env file in ComfyUI directory (a user action). The skill does not modify other skills or system-wide settings by itself.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install bailian-image-gen
  3. After installation, invoke the skill by name or use /bailian-image-gen
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
- Added new sample files: .env, yunxian_huangjiu.png, yunxian_huangjiu_v2.png - Removed README.md - Minor text change: API key documentation now references bailian.console.aliyun.com - Reference links in "References" section updated to plain text for Alibaba Cloud Bailian Console, OpenClaw Documentation, and ComfyUI GitHub
v1.0.0
- Initial release of bailian-image-gen v1.0.0. - Supports high-quality text-to-image and image-to-image generation via Alibaba Cloud Bailian's Qwen Image 2.0 model. - Provides Python API, CLI tool, and ComfyUI custom nodes for flexible integration. - Automatic handling of reference image size limits; synchronous calls for instant results. - Targeted for product promotion, e-commerce image editing, and marketing material creation.
Metadata
Slug bailian-image-gen
Version 1.0.1
License MIT-0
All-time Installs 2
Active Installs 2
Total Versions 2
Frequently Asked Questions

What is Alibaba Cloud Bailian Qwen Image 2.0 image generation. Supports text-to-image and image-to-image (reference image + text). For product promotion image generation, e-commerce image editing, marketing material creation. Provides Python API, CLI tool, and ComfyUI custom nodes.?

Alibaba Cloud Bailian Qwen Image 2.0 image generation. Supports text-to-image and image-to-image (reference image + text). For product promotion image genera... It is an AI Agent Skill for Claude Code / OpenClaw, with 398 downloads so far.

How do I install Alibaba Cloud Bailian Qwen Image 2.0 image generation. Supports text-to-image and image-to-image (reference image + text). For product promotion image generation, e-commerce image editing, marketing material creation. Provides Python API, CLI tool, and ComfyUI custom nodes.?

Run "/install bailian-image-gen" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Alibaba Cloud Bailian Qwen Image 2.0 image generation. Supports text-to-image and image-to-image (reference image + text). For product promotion image generation, e-commerce image editing, marketing material creation. Provides Python API, CLI tool, and ComfyUI custom nodes. free?

Yes, Alibaba Cloud Bailian Qwen Image 2.0 image generation. Supports text-to-image and image-to-image (reference image + text). For product promotion image generation, e-commerce image editing, marketing material creation. Provides Python API, CLI tool, and ComfyUI custom nodes. is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Alibaba Cloud Bailian Qwen Image 2.0 image generation. Supports text-to-image and image-to-image (reference image + text). For product promotion image generation, e-commerce image editing, marketing material creation. Provides Python API, CLI tool, and ComfyUI custom nodes. support?

Alibaba Cloud Bailian Qwen Image 2.0 image generation. Supports text-to-image and image-to-image (reference image + text). For product promotion image generation, e-commerce image editing, marketing material creation. Provides Python API, CLI tool, and ComfyUI custom nodes. is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Alibaba Cloud Bailian Qwen Image 2.0 image generation. Supports text-to-image and image-to-image (reference image + text). For product promotion image generation, e-commerce image editing, marketing material creation. Provides Python API, CLI tool, and ComfyUI custom nodes.?

It is built and maintained by navygo (@navygo); the current version is v1.0.1.

💬 Comments