← 返回 Skills 市场
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.

作者 navygo · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ⚠ suspicious
398
总下载
1
收藏
2
当前安装
2
版本数
在 OpenClaw 中安装
/install bailian-image-gen
功能描述
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...
使用说明 (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

安全使用建议
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.
功能分析
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.
能力评估
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.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install bailian-image-gen
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /bailian-image-gen 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
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.
元数据
Slug bailian-image-gen
版本 1.0.1
许可证 MIT-0
累计安装 2
当前安装数 2
历史版本数 2
常见问题

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... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 398 次。

如何安装 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.?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install bailian-image-gen」即可一键安装,无需额外配置。

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 generation, e-commerce image editing, marketing material creation. Provides Python API, CLI tool, and ComfyUI custom nodes. 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

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 generation, e-commerce image editing, marketing material creation. Provides Python API, CLI tool, and ComfyUI custom nodes. 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 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.?

由 navygo(@navygo)开发并维护,当前版本 v1.0.1。

💬 留言讨论