Skip to main content

Sketch-to-Image

Easily create sketch-to-image artwork using the Wanx Sketch-to-Image model. Provide a hand-drawn sketch and any text description.

This document applies only to the China (Beijing) region. Use an API key from this region.

Basic Introduction

Wanx Sketch-to-Image generates exquisite artwork from hand-drawn sketches and text descriptions. The generated artwork references the hand-drawn lines while maintaining creativity and visual appeal. Sketch-to-Image supports five styles: flat illustration, oil painting, anime, 3D cartoon, and watercolor. You can use it for creative entertainment, auxiliary design, and children's education.

Scenarios

  • Creative greeting card design: Use the Sketch-to-Image feature to create a warm scene, such as Santa Claus and reindeer in the snow, combining holiday themes with personal creativity. This adds personalization and emotional expression to greeting cards, making recipients feel a more sincere and special blessing.
  • Children's picture book creation: Educators or parents can create educational and engaging illustrated picture books based on children's interests and stories. This enhances children's reading interest and fosters imagination and creativity.
  • Personalized product design: E-commerce platforms or designers can quickly generate product designs with unique artistic styles, such as doodle patterns on T-shirts, phone cases, or mugs. This meets consumer demand for personalized and customized products.
  • Social media content creation: Bloggers and content creators can use Sketch-to-Image to create original doodle illustrations that match their content themes. This increases visual appeal, helps establish a unique personal brand, and attracts and retains followers.
  • Interior decoration design: Interior designers can customize personalized wall art or decorative patterns for clients, such as creating doodle artwork in a style that matches the room. This enables personalized space customization and enhances the artistic atmosphere of living or office environments.

Key Features

  • Knowledge Reorganization & Variable-Dimension Diffusion Model: This large AI model, designed for localized painting creation, is based on the in-house developed Composer compositional generation framework. It leverages knowledge reorganization and a variable-dimension diffusion model to generate images in diverse styles that conform to semantic descriptions.
  • Industry-leading results: Generated images have more precise semantic consistency. AI art creations feature natural layouts, rich details, delicate visuals, and realistic outcomes. The artwork references hand-drawn lines while maintaining creativity and visual appeal.
  • Diverse doodle styles: Supports five styles: flat illustration, oil painting, anime, 3D cartoon, and watercolor.
  • Stable, easy-to-use platform service: Provides stable image generation responses under high concurrency and heavy traffic, with 99.99% reliability. It offers simple training and inference API interfaces that are easy to invoke, integrate, and highly compatible.

Model Overview

Model Name

Model Description

Free Quota(View)

Unit Price

Rate Limits (Includes Alibaba Cloud accounts and RAM users)

Task Submission API QPS Limit

Number of Simultaneous Processing Tasks

wanx-sketch-to-image-lite

Wanx Sketch-to-Image generates exquisite sketch artwork from hand-drawn content and text descriptions. The artwork references hand-drawn lines while maintaining creativity and appeal.

500 images

CNY 0.06/image

2

1

Getting Started

Input key image parameters:
  • Hand-drawn sketch: The aspect ratio of the input sketch must match the output resolution to avoid image stretching and distortion. You must use a white background with black lines.
  • Image format: Common bitmap formats such as JPG, PNG, TIFF, and WEBP.
  • Image size: Up to 10 MB.
  • Image resolution: The longer side of the resolution must not exceed 2048 pixels.
image
Because model computation takes a long time, the example code demonstrates asynchronous invocation to prevent request timeouts. Obtain an API key and export the API key as an environment variable. If you use an SDK to make calls, install the DashScope SDK.
  • curl
  • Python
  • Java
1. Create a Sketch-to-Image taskThe API returns a task ID. Use this task ID to query the image generation results.
curl --location 'https://dashscope.aliyuncs.com/api/v1/services/aigc/image2image/image-synthesis' \
--header 'X-DashScope-Async: enable' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
    "model": "wanx-sketch-to-image-lite",
    "input": {
        "sketch_image_url": "https://help-static-aliyun-doc.aliyuncs.com/assets/img/zh-CN/6609471071/p743851.jpg",
        "prompt": "A towering tree"
    },
    "parameters": {
        "size": "768*768",
        "n": 2,
        "sketch_weight": 3,
        "style": "<watercolor>"
    }
}'
2. Query results by task ID
curl -X GET \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
https://dashscope.aliyuncs.com/api/v1/tasks/{your_task_id}

API reference

For the API request and response parameters, see Wanxiang (Scribble-to-Image).
Token Plan
Model Playground
Fine-tuning
Model Compression
Statistics and Monitoring
Support