General image editing - Wanx 2.1

更新时间:
复制 MD 格式

The Wanx general image editing model uses text instructions to perform various image editing tasks, such as outpainting, watermark removal, style transfer, instruction-based editing, inpainting, and image restoration.

Important

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

Model overview

Example results

image

Original image

image

Change her hair to red

35779519-bfc3-4b0a-a594-d764fe9a46d83005601501

You can put a pair of sunglasses on her.

image

Convert to French picture book style

For more examples, see Key capabilities.

Model and pricing

Model name

Unit price

Rate limiting (shared by root accounts and RAM users)

Free quota(View)

RPS limit for task submission API

Concurrent tasks

wanx2.1-imageedit

CNY 0.14/image

2

2

500 images

Getting Started

Prerequisites

Before making a call, obtain an API key, and then configure the API key as an environment variable (to be deprecated and merged into API key configuration). If you use the DashScope SDK, you must also install the SDK.

Sample code

This section shows how to call the general image editing API to perform an inpainting task.

The SDK encapsulates the asynchronous processing logic. The upper-level interface behaves as a synchronous call, which means it sends a single request and waits for the final result. The curl example corresponds to two separate asynchronous API operations: one to submit the task and another to query the result.

Python

This example supports three image input methods: public URL, Base64 encoding, and local file path.

Request example

import base64
import os
from http import HTTPStatus
from dashscope import ImageSynthesis
import mimetypes

"""
Environment requirements:
    dashscope python SDK >= 1.23.8
Install/Upgrade SDK:
    pip install -U dashscope
"""

# If the environment variable is not configured, replace the following line with: api_key="sk-xxx"
api_key = os.getenv("DASHSCOPE_API_KEY")


# --- Helper function: for Base64 encoding ---
# Format is data:{MIME_type};base64,{base64_data}
def encode_file(file_path):
    mime_type, _ = mimetypes.guess_type(file_path)
    if not mime_type or not mime_type.startswith("image/"):
        raise ValueError("Unsupported or unrecognized image format")
    with open(file_path, "rb") as image_file:
        encoded_string = base64.b64encode(image_file.read()).decode('utf-8')
    return f"data:{mime_type};base64,{encoded_string}"

"""
Image input methods:
Choose one of the following three methods.

1. Use a public URL - suitable for publicly accessible images.
2. Use a local file - suitable for local development and testing.
3. Use Base64 encoding - suitable for private images or scenarios requiring encrypted transmission.
"""

# [Method 1] Use a public image URL
mask_image_url = "http://wanx.alicdn.com/material/20250318/description_edit_with_mask_3_mask.png"
base_image_url = "http://wanx.alicdn.com/material/20250318/description_edit_with_mask_3.jpeg"

# [Method 2] Use a local file (supports absolute and relative paths)
# Format requirement: file:// + file path
# Example (absolute path):
# mask_image_url = "file://" + "/path/to/your/mask_image.png"     # Linux/macOS
# base_image_url = "file://" + "C:/path/to/your/base_image.jpeg"  # Windows
# Example (relative path):
# mask_image_url = "file://" + "./mask_image.png"                 # Based on the actual path
# base_image_url = "file://" + "./base_image.jpeg"                # Based on the actual path

# [Method 3] Use a Base64-encoded image
# mask_image_url = encode_file("./mask_image.png")               # Based on the actual path
# base_image_url = encode_file("./base_image.jpeg")              # Based on the actual path


def sample_sync_call_imageedit():
    print('please wait...')
    rsp = ImageSynthesis.call(api_key=api_key,
                              model="wanx2.1-imageedit",
                              function="description_edit_with_mask",
                              prompt="A ceramic rabbit holding a ceramic flower",
                              mask_image_url=mask_image_url,
                              base_image_url=base_image_url,
                              n=1)
    assert rsp.status_code == HTTPStatus.OK

    print('response: %s' % rsp)
    if rsp.status_code == HTTPStatus.OK:
        for result in rsp.output.results:
            print("---------------------------")
            print(result.url)
    else:
        print('sync_call Failed, status_code: %s, code: %s, message: %s' %
              (rsp.status_code, rsp.code, rsp.message))


if __name__ == '__main__':
    sample_sync_call_imageedit()

Response example

The URL is valid for 24 hours. Download the image promptly.
{
    "status_code": 200,
    "request_id": "dc41682c-4e4a-9010-bc6f-xxxxxx",
    "code": null,
    "message": "",
    "output": {
        "task_id": "6e319d88-a07a-420c-9493-xxxxxx",
        "task_status": "SUCCEEDED",
        "results": [
            {
                "url": "https://dashscope-result-wlcb-acdr-1.oss-cn-wulanchabu-acdr-1.aliyuncs.com/xxx.png?xxxxxx"
            }
        ],
        "submit_time": "2025-05-26 14:58:27.320",
        "scheduled_time": "2025-05-26 14:58:27.339",
        "end_time": "2025-05-26 14:58:39.170",
        "task_metrics": {
            "TOTAL": 1,
            "SUCCEEDED": 1,
            "FAILED": 0
        }
    },
    "usage": {
        "image_count": 1
    }
}

Java

This example supports three image input methods: public URL, Base64 encoding, and local file path.

Request example

// Copyright (c) Alibaba, Inc. and its affiliates.

import com.alibaba.dashscope.aigc.imagesynthesis.ImageSynthesis;
import com.alibaba.dashscope.aigc.imagesynthesis.ImageSynthesisParam;
import com.alibaba.dashscope.aigc.imagesynthesis.ImageSynthesisResult;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.utils.JsonUtils;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Base64;
import java.util.HashMap;
import java.util.Map;

/**
 * Environment requirements
 *      dashscope java SDK >=2.20.9
 * Update Maven dependency:
 *      https://mvnrepository.com/artifact/com.alibaba/dashscope-sdk-java
 */
 
public class ImageEditSync {

    // If the environment variable is not configured, replace the following line with: apiKey="sk-xxx"
    static String apiKey = System.getenv("DASHSCOPE_API_KEY");

    /**
     * Image input methods: Choose one of the following three.
     *
     * 1. Use a public URL - suitable for publicly accessible images.
     * 2. Use a local file - suitable for local development and testing.
     * 3. Use Base64 encoding - suitable for private images or scenarios requiring encrypted transmission.
     */

    //[Method 1] Public URL
    static String maskImageUrl = "http://wanx.alicdn.com/material/20250318/description_edit_with_mask_3_mask.png";
    static String baseImageUrl = "http://wanx.alicdn.com/material/20250318/description_edit_with_mask_3.jpeg";

    //[Method 2] Local file path (file://+absolute path or file:///+absolute path)
    // static String maskImageUrl = "file://" + "/your/path/to/mask_image.png";    // Linux/macOS
    // static String baseImageUrl = "file:///" + "C:/your/path/to/base_image.png";  // Windows

    //[Method 3] Base64 encoding
    // static String maskImageUrl = encodeFile("/your/path/to/mask_image.png");
    // static String baseImageUrl = encodeFile("/your/path/to/base_image.png");


    public static void syncCall() {
        // Set the parameters parameter
        Map<String, Object> parameters = new HashMap<>();
        parameters.put("prompt_extend", true);

        ImageSynthesisParam param =
                ImageSynthesisParam.builder()
                        .apiKey(apiKey)
                        .model("wanx2.1-imageedit")
                        .function(ImageSynthesis.ImageEditFunction.DESCRIPTION_EDIT_WITH_MASK)
                        .prompt("A ceramic rabbit holding a ceramic flower")
                        .maskImageUrl(maskImageUrl)
                        .baseImageUrl(baseImageUrl)
                        .n(1)
                        .size("1024*1024")
                        .parameters(parameters)
                        .build();

        ImageSynthesis imageSynthesis = new ImageSynthesis();
        ImageSynthesisResult result = null;
        try {
            System.out.println("---sync call, please wait a moment----");
            result = imageSynthesis.call(param);
        } catch (ApiException | NoApiKeyException e){
            throw new RuntimeException(e.getMessage());
        }
        System.out.println(JsonUtils.toJson(result));
    }

    /**
     * Encodes a file into a Base64 string
     * @param filePath The file path
     * @return A Base64 string in the format data:{MIME_type};base64,{base64_data}
     */
    public static String encodeFile(String filePath) {
        Path path = Paths.get(filePath);
        if (!Files.exists(path)) {
            throw new IllegalArgumentException("File does not exist: " + filePath);
        }
        // Detect the MIME type
        String mimeType = null;
        try {
            mimeType = Files.probeContentType(path);
        } catch (IOException e) {
            throw new IllegalArgumentException("Cannot detect file type: " + filePath);
        }
        if (mimeType == null || !mimeType.startsWith("image/")) {
            throw new IllegalArgumentException("Unsupported or unrecognized image format");
        }
        // Read the file content and encode it
        byte[] fileBytes = null;
        try{
            fileBytes = Files.readAllBytes(path);
        } catch (IOException e) {
            throw new IllegalArgumentException("Cannot read file content: " + filePath);
        }

        String encodedString = Base64.getEncoder().encodeToString(fileBytes);
        return "data:" + mimeType + ";base64," + encodedString;
    }

    public static void main(String[] args) {
        syncCall();
    }
}

Response example

The URL is valid for 24 hours. Download the image promptly.
{
    "request_id": "bf6c6361-f0fc-949c-9d60-xxxxxx",
    "output": {
        "task_id": "958db858-153b-4c81-b243-xxxxxx",
        "task_status": "SUCCEEDED",
        "results": [
            {
                "url": "https://dashscope-result-wlcb-acdr-1.oss-cn-wulanchabu-acdr-1.aliyuncs.com/xxx.png?xxxxxx"
            }
        ],
        "task_metrics": {
            "TOTAL": 1,
            "SUCCEEDED": 1,
            "FAILED": 0
        }
    },
    "usage": {
        "image_count": 1
    }
}

curl

This example covers the entire process from creating a task and polling its status to retrieving and saving the result.

Note
  • For asynchronous calls, you must set the header parameter X-DashScope-Async to enable.

  • The task_id of an asynchronous task is valid for queries for 24 hours. After this period, the task status changes to UNKNOWN.

  • For beginners, use Postman to call the API.

Step 1: Submit a task creation request

This request returns a task ID (task_id).

Request example

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": "wanx2.1-imageedit",
  "input": {
    "function": "description_edit_with_mask",
    "prompt": "A ceramic rabbit holding a ceramic flower.",
    "base_image_url": "http://wanx.alicdn.com/material/20250318/description_edit_with_mask_3.jpeg",
    "mask_image_url": "http://wanx.alicdn.com/material/20250318/description_edit_with_mask_3_mask.png"
  },
  "parameters": {
    "n": 1
  }
}'

Response example

{
    "output": {
        "task_status": "PENDING",
        "task_id": "0385dc79-5ff8-4d82-bcb6-xxxxxx"
    },
    "request_id": "4909100c-7b5a-9f92-bfe5-xxxxxx"
}

Step 2: Query the result by task ID

Use the task_id from the previous step to poll the task status through the API until the task_status becomes SUCCEEDED or FAILED.

Request example

Replace 86ecf553-d340-4e21-xxxxxxxxx with the actual task ID.

curl -X GET https://dashscope.aliyuncs.com/api/v1/tasks/86ecf553-d340-4e21-xxxxxxxxx \
--header "Authorization: Bearer $DASHSCOPE_API_KEY"

Response example

The image URL is valid for 24 hours. Download the image promptly.
{
    "request_id": "eeef0935-02e9-9742-bb55-xxxxxx",
    "output": {
        "task_id": "a425c46f-dc0a-400f-879e-xxxxxx",
        "task_status": "SUCCEEDED",
        "submit_time": "2025-02-21 17:56:31.786",
        "scheduled_time": "2025-02-21 17:56:31.821",
        "end_time": "2025-02-21 17:56:42.530",
        "results": [
            {
                "url": "https://dashscope-result-sh.oss-cn-shanghai.aliyuncs.com/aaa.png"
            }
        ],
        "task_metrics": {
            "TOTAL": 1,
            "SUCCEEDED": 1,
            "FAILED": 0
        }
    },
    "usage": {
        "image_count": 1
    }
}

Key capabilities

The general image editing API uses the function parameter to specify different image editing features. All features follow the calling method described in Getting Started.

The following sections use curl calls as examples. They list only the specific input and parameters JSON snippets for each feature to show the required request body configuration.

Note: A complete curl request must include top-level fields such as model, input, and parameters. For the specific structure, see the General Image Editing API Reference.

Global stylization

This feature transfers the style of an entire image to a specified artistic style. Scenarios include creating picture books and generating backgrounds or concept images for social media that match a specific visual style.

  • How to use: Set the function parameter to stylization_all.

  • Supported styles:

    • French picture book style

    • Gold foil art style

  • Related parameter: parameters.strength (0.0–1.0, default 0.5) controls the modification intensity. A smaller value produces an image closer to the original.

  • Prompt tip: Use the phrase "Convert to xx style", such as "Convert to French picture book style".

Request example

{
  "input": {
    "function": "stylization_all",
    "prompt": "Convert to French picture book style",
    "base_image_url": "http://wanx.alicdn.com/material/20250318/stylization_all_3.png"
  },
  "parameters": {
    "strength": 0.5
  }
}

Input image

Output image

Prompt: Convert to French picture book style

Prompt: Convert to gold foil art style

image

image

image

image

image

image

Control modification intensity with strength

You can use the parameters.strength parameter to control the image modification intensity. This is an optional parameter with a value range of [0.0, 1.0] and a default value of 0.5. A value closer to 0 produces a result that is more similar to the original image. A value closer to 1 applies a greater modification to the original image.

Input prompt: Convert to French picture book style.

Input image

Output image

strength=0.0 (minimum)

strength=0.5 (default)

strength=1.0 (maximum)

image

image

image

image

Local stylization

This feature applies style transfer to a specific area of an image. Scenarios include personalization, such as stylizing a person's clothing, and advertising design to highlight a product.

  • How to use: Set the function parameter to stylization_local.

  • Supported styles: The following styles are supported:

    • Ice sculpture

    • Cloud

    • chinese festive lantern

    • Board: Wooden

    • blue and white porcelain

    • fluffy

    • Wool yarn for weaving

    • balloon

  • Prompt tip: Use the phrase "Change xx to xx style", such as "Change the house to wooden style".

Request example

{
  "input": {
    "function": "stylization_local",
    "prompt": "Change the house to wooden style",
    "base_image_url": "http://wanx.alicdn.com/material/20250318/stylization_local_1.png"
  }
}

Input image

Output image

image

image

Ice sculpture

image

cloud

image

chinese festive lantern

image

Plank

image

blue and white porcelain

image

fluffy

image Wool yarn

image

balloon

Instruction-based editing

This feature adds or modifies image content using only text instructions, without requiring you to specify a region. Scenarios include simple edits that do not require precise positioning, such as adding accessories to a person or changing hair color.

  • How to use: Set the function parameter to description_edit.

  • Related parameter: parameters.strength (0.0–1.0, default 0.5) controls the modification intensity. A smaller value produces an image closer to the original.

  • Prompt tip: Explicitly state actions such as "add" or "change". For deletion, we recommend using Inpainting.

Request example

{
  "input": {
    "function": "description_edit",
    "prompt": "Add a pair of sunglasses to the cat",
    "base_image_url": "http://wanx.alicdn.com/material/20250318/description_edit_1.jpeg"
  },
  "parameters": {
    "strength": 0.5
  }
}

Capability

Input image

Output image

Add element

image

image

Add a pair of sunglasses to the cat.

Modify element

image

image

Change her hair to red.

Control modification intensity with strength

You can use the parameters.strength parameter to control the image modification intensity. This is an optional parameter with a value range of [0.0, 1.0] and a default value of 0.5. A value closer to 0 produces a result that is more similar to the original image. A value closer to 1 applies a greater modification to the original image.

Input prompt: Change the clothes she is wearing to a colorful printed beach shirt.

Input image

Output image

strength=0.0 (minimum)

strength=0.5 (default)

strength=1.0 (maximum)

image

image

image

image

Inpainting

This feature adds, modifies, or removes content in a specified area using a mask image. Scenarios include edits that require precise control, such as changing clothes, replacing objects, or removing distractions.

  • How to use: Set the function parameter to description_edit_with_mask.

  • Mask requirements: You must provide a mask_image_url. In the mask image, the white area is the region to be edited, and the black area is the region to be preserved.

  • Prompt tips: Explicitly describe the operation, such as "add", "change", or describe the content after deletion.

    • Add/Modify: You can describe the action ("Add a hat to the dog") or the final result ("A dog wearing a hat").

    • Delete: If the object to be deleted is small, you can leave the prompt empty (""). If the object is large, the prompt must describe the background content that should appear after deletion, such as "A transparent glass vase on the table". Do not use prompts such as "Delete the bear".

Request example

{
  "input": {
    "function": "description_edit_with_mask",
    "prompt": "A ceramic rabbit holding a ceramic flower",
    "base_image_url": "http://wanx.alicdn.com/material/20250318/description_edit_with_mask_1.jpeg",
    "mask_image_url": "http://wanx.alicdn.com/material/20250318/description_edit_with_mask_1_mask.png"
  }
}

Capability

Input image

Input mask image

(White is the area to be edited)

Output image

Add element

image

image

image

Add a hat to the dog.

The prompt can also be "A dog wearing a hat" (describing the desired image content).

Modify element

image

image

image

A ceramic rabbit holding a ceramic flower.

The prompt can also be "Change the carrot held by the ceramic rabbit to a ceramic flower" (describing the action).

Delete element

image

image

image

A transparent glass vase on the table.

The prompt must describe the content after deletion. Do not write "Delete a brown bear".

Remove text watermarks

Note

Legal risk warning

Using this feature to process copyrighted images, such as removing another party's brand watermark, may constitute copyright infringement. Ensure that you have the legal right to use the images you process and assume all related legal responsibilities.

This feature removes Chinese and English characters or common watermarks from an image. Scenarios include reprocessing stock images and cleaning up ad visuals.

  • How to use: Set the function parameter to remove_watermark.

  • Prompt tip: You can use a general instruction such as "Remove text from the image" or specify a type, such as "Remove English text".

Request example

{
  "input": {
    "function": "remove_watermark",
    "prompt": "Remove text from the image",
    "base_image_url": "http://wanx.alicdn.com/material/20250318/remove_watermark_1.png"
  }
}

Input image

Output image (Remove text from the image)

image

image

image

image

Outpainting

This feature extends the canvas proportionally in the up, down, left, and right directions and intelligently fills the new areas with content. Scenarios include adjusting composition and converting a portrait-oriented image to a landscape-oriented image to fit different media dimensions.

  • How to use: Set the function parameter to expand.

  • Related parameters: In parameters, top_scale, bottom_scale, left_scale, and right_scale control the expansion ratio for each direction. For example, setting all to 1.5 expands the image to 1.5 times its original size.

  • Prompt tip: Describe the complete scene you expect to see after the expansion.

Request example

{
  "input": {
    "function": "expand",
    "prompt": "A family on a park lawn",
    "base_image_url": "http://wanx.alicdn.com/material/20250318/expand_1.jpeg"
  },
  "parameters": {
    "top_scale": 1.5,
    "bottom_scale": 1.5,
    "left_scale": 1.5,
    "right_scale": 1.5
  }
}

Input image

Output image

image

image

Super resolution

This feature improves image definition and supports upscaling to make low-resolution or blurry images clear. Scenarios include restoring old photos and increasing the resolution of stock images to meet high-definition printing or display requirements.

  • How to use: Set the function parameter to super_resolution.

  • Related parameter: parameters.upscale_factor (1–4, default 1) controls the upscaling factor. A value of 1 improves only the definition without upscaling.

  • Prompt tip: You can use "image super resolution" or describe the image content.

Request example

{
  "input": {
    "function": "super_resolution",
    "prompt": "image super resolution",
    "base_image_url": "http://wanx.alicdn.com/material/20250318/super_resolution_1.jpeg"
  },
  "parameters": {
    "upscale_factor": 2
  }
}

Input image (blurry image)

Output image (clear image)

image

image

Image colorization

This feature converts a black and white or grayscale image to a color image. Scenarios include colorizing historical photos and adding color to sketches or grayscale images.

  • How to use: Set the function parameter to colorization.

  • Prompt tip: You can leave the prompt empty to let the model colorize automatically, or specify the colors of key elements in the prompt (such as "blue background, yellow leaves").

Request example

{
  "input": {
    "function": "colorization",
    "prompt": "blue background, yellow leaves",
    "base_image_url": "http://wanx.alicdn.com/material/20250318/colorization_1.jpeg"
  }
}

Input image

Output image

image

image

Sketch to image (supports doodle to image)

This feature generates a new image based on the contours (sketch) of an input image combined with a text prompt. Scenarios include architectural concept design, illustration design, and doodle-to-image generation.

  • How to use: Set the function parameter to doodle.

  • Related parameter: parameters.is_sketch controls the model's generation effect.

    • false (default): The input is an RGB image. The model first extracts the sketch and then generates a new image (RGB image → sketch → new image).

    • true: The input is an RGB image (such as a doodle or sketch). The model directly generates a new image based on this input (RGB image → new image).

  • Prompt tip: Describe the desired image content. The more specific the description, the better the result.

Request example 1: Sketch to image

{
  "input": {
    "function": "doodle",
    "prompt": "A living room in Nordic minimalist style.",
    "base_image_url": "http://wanx.alicdn.com/material/20250318/doodle_1.png"
  },
  "parameters": {
    "is_sketch": false
  }
}

Request example 2: Doodle to image

{
  "input": {
    "function": "doodle",
    "prompt": "A tree, in anime style",
    "base_image_url": "http://wanx.alicdn.com/material/20250318/doodle_2.png"
  },
  "parameters": {
    "is_sketch": true
  }
}

Capability

Input image

Output image

Sketch to image

(is_sketch=false)

image

image

A living room in Nordic minimalist style.

Doodle Drawing

(is_sketch=true)

image

image

A tree, in anime style.

Generate image from cartoon reference

Note

Legal risk warning

Using this feature to process copyrighted cartoon characters may constitute copyright infringement. Ensure that you have the legal right to use the referenced character or use your own original character, and assume all related legal responsibilities.

  • How to use: Set the function parameter to control_cartoon_feature.

  • Prompt tip: Use the phrase "A cartoon character..." and describe the character's actions and environment in detail.

Example Request 2: Image Generation from a Doodle

{
  "input": {
    "function": "control_cartoon_feature",
    "prompt": "A cartoon character cautiously peeks its head out, peering at a brilliant blue gem inside the room",
    "base_image_url": "http://wanx.alicdn.com/material/20250318/control_cartoon_feature_1.png"
  }
}

Input image

Output image

image

image

Going live

Best practices

  • Asynchronous polling: When you poll to query asynchronous task results, use a reasonable polling strategy. For example, you can poll every 3 seconds for the first 30 seconds and then increase the interval. This helps avoid triggering rate limiting due to frequent requests.

  • Parameter tuning: For key parameters that affect the result, such as strength, run small-scale tests before going live to find the optimal values for your business scenario.

  • Image storage: The image URL returned by the API is valid for 24 hours. You must download and transfer the generated images to your own persistent storage service, such as Alibaba Cloud OSS, promptly.

Risk prevention

  • Error handling: Check the task_status in the task query result. For a FAILED status, record the code and message for troubleshooting. Some errors, such as system timeouts, may be transient. You can implement a retry logic for these cases.

  • Content moderation: The API performs a security review of input and output content. If the content is not compliant, the request will fail with a DataInspectionFailed error.

API reference

For information about the input and output parameters of the Wanx general image editing model, see the General Image Editing API Reference.

Billing and rate limiting

  • For information about the model's free quota and unit price, see Model list and pricing.

  • For information about model rate limits, see Wanx.

  • Billing details:

    • Billing is based on the number of successfully generated images. You are charged only when the API returns a task_status of SUCCEEDED and an image is successfully generated.

    • Failed model calls or processing errors do not incur any fees and do not consume the free quota.

    • General image editing also supports savings plans. The offset order is: free quota > savings plan > pay-as-you-go.

Error codes

If the model call fails and returns an error message, see Error messages for resolution.

FAQ

Q: Why did my task fail (FAILED)?

A: Common reasons for task failure include the following:

  1. Content moderation failure: The input or generated image content triggered a security policy.

  2. Invalid parameters: The parameters in the request are invalid, such as an incorrect function name or an inaccessible URL.

  3. Internal model error: The model encountered an unexpected issue during processing. Check the code and error fields in the task query response to obtain the specific error code and message to locate the problem.