> ## Documentation Index
> Fetch the complete documentation index at: https://quwan-b8010aef.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 豆包图片生成示例

> 使用豆包 API 进行图片生成的完整示例代码

# 豆包图片生成示例

以下示例展示如何使用豆包 API 生成高质量的图片。

## 快速开始

```bash cURL theme={null}
curl -X POST "https://api.tokenops.ai/v1/images/generations" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <API-KEY>" \
  -d '{
    "prompt": "一只可爱的小猫在花园里玩耍，阳光明媚，油画风格",
    "model": "doubao-seedream-4-0-250828",
    "size": "1024x1024",
    "response_format": "url",
    "watermark": true
  }'
```

```python Python theme={null}
import requests
import json
import base64
from PIL import Image
from io import BytesIO

API_KEY = "<API-KEY>"
BASE_URL = "https://api.tokenops.ai/v1"

def generate_image_doubao(prompt, model="doubao-seedream-4-0-250828", size="1024x1024",
                         watermark=True, response_format="url"):
    """
    使用豆包API生成图片
    
    Args:
        prompt: 图片描述文本
        model: 模型名称，默认doubao-seedream-4-0-250828
        size: 图片尺寸
        watermark: 是否添加水印
        response_format: 返回格式，url或b64_json
    """
    url = f"{BASE_URL}/images/generations"
    headers = {
        "Content-Type": "application/json",
        "Authorization": f"Bearer {API_KEY}"
    }
    
    data = {
        "prompt": prompt,
        "model": model,
        "size": size,
        "response_format": response_format,
        "watermark": watermark
    }
    
    response = requests.post(url, headers=headers, json=data)
    
    if response.status_code == 200:
        result = response.json()
        images = []
        
        # 显示响应信息
        if 'created' in result:
            print(f"生成时间: {result['created']}")
        if 'usage' in result:
            usage = result['usage']
            print(f"Token使用: 总计={usage.get('total_tokens')}, 输出={usage.get('output_tokens')}")
        
        for i, img_data in enumerate(result['data']):
            if response_format == "b64_json" and 'b64_json' in img_data:
                # 处理base64格式
                image_data = base64.b64decode(img_data['b64_json'])
                image = Image.open(BytesIO(image_data))
                filename = f"doubao_generated_{i+1}.png"
                image.save(filename)
                images.append(filename)
                print(f"图片已保存: {filename}")
            elif 'url' in img_data:
                # 处理URL格式（24小时内有效）
                print(f"图片URL: {img_data['url']}")
                images.append(img_data['url'])
                
            # 显示修订后的提示词（如果有）
            if 'revised_prompt' in img_data:
                print(f"修订后的提示词: {img_data['revised_prompt']}")
        
        return images
    else:
        print(f"错误: {response.status_code} - {response.text}")
        return None

# 基础使用示例
if __name__ == "__main__":
    prompt = "一只可爱的小猫在花园里玩耍，阳光明媚，油画风格"
    images = generate_image_doubao(prompt)
    
    if images:
        print(f"成功生成 {len(images)} 张图片")
```

```python Python - 流式生成 theme={null}
import requests
import json
import base64
from PIL import Image
from io import BytesIO

API_KEY = "<API-KEY>"
BASE_URL = "https://api.tokenops.ai/v1"

def generate_image_doubao_stream(prompt, model="doubao-seedream-4-0-250828", size="1024x1024"):
    """
    使用豆包API流式生成图片
    """
    url = f"{BASE_URL}/images/generations"
    headers = {
        "Content-Type": "application/json",
        "Authorization": f"Bearer {API_KEY}"
    }
    
    data = {
        "prompt": prompt,
        "model": model,
        "size": size,
        "stream": True,
        "response_format": "url",
        "watermark": True
    }
    
    response = requests.post(url, headers=headers, json=data, stream=True)
    
    if response.status_code == 200:
        images = []
        for line in response.iter_lines():
            if line:
                line = line.decode('utf-8')
                if line.startswith('data:'):
                    try:
                        json_data = line[5:]  # 移除'data:'前缀
                        if json_data.strip() == '[DONE]':
                            break
                        
                        event = json.loads(json_data)
                        
                        # 处理不同类型的事件
                        if event.get('type') == 'image_generation.partial_succeeded':
                            print(f"图片 {event.get('image_index', 0)} 生成中...")
                        elif event.get('type') == 'image_generation.completed':
                            print("图片生成完成")
                            if 'url' in event:
                                images.append(event['url'])
                                print(f"图片URL: {event['url']}")
                        elif event.get('type') == 'error':
                            print(f"生成错误: {event.get('error', {}).get('message', '未知错误')}")
                            
                    except json.JSONDecodeError as e:
                        print(f"解析JSON失败: {e}")
                        continue
        
        return images
    else:
        print(f"错误: {response.status_code} - {response.text}")
        return None

# 流式生成示例
if __name__ == "__main__":
    prompt = "科幻城市夜景，霓虹灯闪烁，赛博朋克风格"
    images = generate_image_doubao_stream(prompt)
    
    if images:
        print(f"流式生成完成，共 {len(images)} 张图片")
```

```python Python - 高级功能 theme={null}
import requests
import json

API_KEY = "<API-KEY>"
BASE_URL = "https://api.tokenops.ai/v1"

def generate_image_doubao_advanced(prompt, **kwargs):
    """
    豆包图片生成高级功能示例
    
    支持的高级参数：
    - sequential_image_generation: 组图功能控制
    - sequential_image_generation_options: 组图功能配置
    - optimize_prompt_options: 提示词优化配置
    - image: 基于现有图片生成（图片编辑）
    """
    url = f"{BASE_URL}/images/generations"
    headers = {
        "Content-Type": "application/json",
        "Authorization": f"Bearer {API_KEY}"
    }
    
    # 基础参数
    data = {
        "prompt": prompt,
        "model": kwargs.get("model", "doubao-seedream-4-0-250828"),
        "n": kwargs.get("n", 1),
        "size": kwargs.get("size", "1024x1024"),
        "response_format": kwargs.get("response_format", "url"),
        "watermark": kwargs.get("watermark", True)
    }
    
    # 高级功能参数
    if kwargs.get("enable_sequential"):
        data["sequential_image_generation"] = "auto"
        data["sequential_image_generation_options"] = {
            "max_images": kwargs.get("max_images", 4)
        }
    
    if kwargs.get("optimize_prompt"):
        data["optimize_prompt_options"] = {
            "enable": True
        }
    
    if kwargs.get("base_image"):
        data["image"] = kwargs["base_image"]  # URL或base64编码
    
    response = requests.post(url, headers=headers, json=data)
    
    if response.status_code == 200:
        result = response.json()
        print(f"生成时间: {result.get('created')}")
        
        if result.get('usage'):
            usage = result['usage']
            print(f"Token使用: 总计={usage.get('total_tokens')}, 输出={usage.get('output_tokens')}")
        
        return result['data']
    else:
        print(f"错误: {response.status_code} - {response.text}")
        return None

# 高级功能使用示例
if __name__ == "__main__":
    # 1. 组图生成
    print("=== 组图生成示例 ===")
    images = generate_image_doubao_advanced(
        prompt="可爱的动物系列：小猫、小狗、小兔子，卡通风格",
        n=3,
        enable_sequential=True,
        max_images=3,
        optimize_prompt=True
    )
    
    # 2. 基于现有图片的编辑
    print("\n=== 图片编辑示例 ===")
    base_image_url = "https://example.com/base_image.jpg"
    edited_images = generate_image_doubao_advanced(
        prompt="将图片改为水彩画风格",
        base_image=base_image_url
    )
```

## Seedream 5.0 新特性

Seedream 5.0 Pro（`doubao-seedream-5-0-pro-260628`）和 Seedream 5.0 lite（`doubao-seedream-5-0-260128`）相比 4.0 版本新增了以下能力。Pro 版本面向高精度图片生成场景，调用方式与 lite 一致，只需替换 `model` 字段。

### 指定输出格式（output\_format）

5.0 Pro / lite 支持 `png` 和 `jpeg` 两种输出格式（4.0/4.5 仅支持 jpeg）。

```bash cURL - 指定 PNG 格式输出 theme={null}
curl -X POST "https://api.tokenops.ai/v1/images/generations" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <API-KEY>" \
  -d '{
    "prompt": "一只可爱的小猫在花园里玩耍，阳光明媚",
    "model": "doubao-seedream-5-0-pro-260628",
    "n": 1,
    "size": "2K",
    "output_format": "png",
    "response_format": "url"
  }'
```

```python Python - 指定 PNG 格式输出 theme={null}
import requests

API_KEY = "<API-KEY>"
BASE_URL = "https://api.tokenops.ai/v1"

response = requests.post(
    f"{BASE_URL}/images/generations",
    headers={
        "Content-Type": "application/json",
        "Authorization": f"Bearer {API_KEY}"
    },
    json={
        "prompt": "一只可爱的小猫在花园里玩耍，阳光明媚",
        "model": "doubao-seedream-5-0-pro-260628",
        "n": 1,
        "size": "2K",
        "output_format": "png",
        "response_format": "url"
    }
)

result = response.json()
print(result["data"][0]["url"])
```

### 联网搜索（web\_search）

5.0 lite 支持联网搜索工具，模型会根据提示词自主判断是否需要搜索互联网内容，提升生成图片的时效性。通过 `tools` 参数开启。

```bash cURL - 联网搜索生图 theme={null}
curl -X POST "https://api.tokenops.ai/v1/images/generations" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <API-KEY>" \
  -d '{
    "prompt": "上海今日天气预报，天气可视化信息图",
    "model": "doubao-seedream-5-0-pro-260628",
    "size": "2K",
    "tools": [{"type": "web_search"}],
    "response_format": "url"
  }'
```

```python Python - 联网搜索生图 theme={null}
import requests

API_KEY = "<API-KEY>"
BASE_URL = "https://api.tokenops.ai/v1"

response = requests.post(
    f"{BASE_URL}/images/generations",
    headers={
        "Content-Type": "application/json",
        "Authorization": f"Bearer {API_KEY}"
    },
    json={
        "prompt": "上海今日天气预报，天气可视化信息图",
        "model": "doubao-seedream-5-0-pro-260628",
        "size": "2K",
        "tools": [{"type": "web_search"}],
        "response_format": "url"
    }
)

result = response.json()
print(result["data"][0]["url"])

# 查看是否实际触发了联网搜索
usage = result.get("usage", {})
tool_usage = usage.get("tool_usage", {})
print(f"联网搜索次数: {tool_usage.get('web_search', 0)}")
```

> [!NOTE]
>
> **联网搜索说明**：
>
> * 开启后模型会根据提示词**自主判断**是否需要搜索，不一定每次都会触发
> * 实际搜索次数可通过响应中的 `usage.tool_usage.web_search` 字段查看
> * 联网搜索会增加一定的响应时延
> * 仅 Seedream 5.0 Pro / lite 支持，4.0/4.5 不支持

## 重要提示

> [!WARNING]
>
> **doubao-seedream-4-0-250828 模型参数限制**：
>
> * `guidance_scale` 参数不支持，传入会报错
> * `seed` 参数可以传入但不生效，无法重现相同结果

> [!NOTE]
>
> **多图片参数说明**：
>
> * `image` 参数支持单个字符串URL或字符串URL数组格式
> * JSON数组会被正确解析和处理，无需担心类型转换问题
> * 不同功能需要使用对应的模型（详见各功能示例）

## 支持的模型

| 模型 | Model ID | 分辨率 | 输出格式 | 联网搜索 |
| - | - | - | - | - |
| Seedream 5.0 Pro | `doubao-seedream-5-0-pro-260628` | 1K, 2K | png, jpeg | 支持 |
| Seedream 5.0 lite | `doubao-seedream-5-0-260128` | 2K, 3K, 4K | png, jpeg | 支持 |
| Seedream 4.5 | `doubao-seedream-4-5-251128` | 2K, 4K | jpeg | 不支持 |
| Seedream 4.0 | `doubao-seedream-4-0-250828` | 1K, 2K, 4K | jpeg | 不支持 |

## 支持的分辨率

`size` 参数支持两种设置方式（不可混用）：

**方式 1：分辨率等级**（如 `"2K"`、`"3K"`），由模型根据提示词决定宽高比。

**方式 2：精确像素值**（如 `"2048x2048"`），推荐值如下：

### Seedream 5.0 Pro / lite

**2K 分辨率：**

| 宽高比 | 像素 |
| - | - |
| 1:1 | 2048x2048 |
| 3:4 | 1728x2304 |
| 4:3 | 2304x1728 |
| 16:9 | 2848x1600 |
| 9:16 | 1600x2848 |
| 3:2 | 2496x1664 |
| 2:3 | 1664x2496 |
| 21:9 | 3136x1344 |

**3K 分辨率：**

| 宽高比 | 像素 |
| - | - |
| 1:1 | 3072x3072 |
| 3:4 | 2592x3456 |
| 4:3 | 3456x2592 |
| 16:9 | 4096x2304 |
| 9:16 | 2304x4096 |
| 2:3 | 2496x3744 |
| 3:2 | 3744x2496 |
| 21:9 | 4704x2016 |

## 支持的参数

### 基础参数

* **prompt**: 图片描述文本（必需），建议不超过 300 汉字或 600 英文单词
* **model**: 模型名称
* **n**: 生成图片数量。Seedream 5.0 Pro 当前仅支持生成单图
* **size**: 图片尺寸，分辨率等级（如 `"1K"`、`"2K"`、`"3K"`）或精确像素值（如 `"2048x2048"`）。Seedream 5.0 Pro 支持 `1K`、`2K`
* **response\_format**: 返回格式（`url` 或 `b64_json`）
* **output\_format**: 输出图片格式（`png` 或 `jpeg`），仅 5.0 Pro / lite 支持 png
* **seed**: 随机数种子，-1 表示随机

### 画质控制参数

* **watermark**: 是否添加水印，默认 `true`

### 高级功能参数

* **stream**: 是否启用流式输出，默认 `false`
* **tools**: 工具列表，如 `[{"type": "web_search"}]` 开启联网搜索（仅 5.0 Pro / lite）
* **sequential\_image\_generation**: 组图功能控制（`auto` 或 `disabled`）
* **sequential\_image\_generation\_options**: 组图功能配置
  * **max\_images**: 最大图片数量
* **Seedream 5.0 Pro 注意事项**: `doubao-seedream-5-0-pro-260628` 不支持 `sequential_image_generation` / `sequential_image_generation_options`，调用 Pro 时请不要传这两个字段
* **optimize\_prompt\_options**: 提示词优化配置
  * **mode**: 优化模式（`standard`）
* **image**: 基础图片，支持 URL 或 Base64 编码（用于图片编辑），最多 14 张

## 图片到图片生成示例

豆包还支持基于现有图片生成新图片的功能，通过 `image` 参数提供参考图片URL：

```bash cURL - 图片到图片 theme={null}
curl -X POST "https://api.tokenops.ai/v1/images/generations" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <API-KEY>" \
  -d '{
    "prompt": "生成狗狗趴在草地上的近景画面",
    "image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream4_imageToimage.png",
    "model": "doubao-seedream-4-0-250828",
    "size": "1024x1024",
    "response_format": "url",
    "watermark": true
  }'
```

```python Python - 图片到图片 theme={null}
import requests

API_KEY = "<API-KEY>"
BASE_URL = "https://api.tokenops.ai/v1"

def generate_image_from_image(prompt, base_image_url, model="doubao-seedream-4-0-250828", size="1024x1024"):
    """
    基于现有图片生成新图片
    
    Args:
        prompt: 生成描述
        base_image_url: 参考图片的URL
        model: 模型名称
        size: 输出图片尺寸
    """
    url = f"{BASE_URL}/images/generations"
    headers = {
        "Content-Type": "application/json",
        "Authorization": f"Bearer {API_KEY}"
    }
    
    data = {
        "prompt": prompt,
        "image": base_image_url,
        "model": model,
        "size": size,
        "response_format": "url",
        "watermark": True
    }
    
    response = requests.post(url, headers=headers, json=data)
    
    if response.status_code == 200:
        result = response.json()
        print(f"生成时间: {result.get('created')}")
        
        if result.get('usage'):
            usage = result['usage']
            print(f"Token使用: 总计={usage.get('total_tokens')}, 输出={usage.get('output_tokens')}")
        
        for i, img_data in enumerate(result['data']):
            if 'url' in img_data:
                print(f"生成的图片URL: {img_data['url']}")
                return img_data['url']
    else:
        print(f"错误: {response.status_code} - {response.text}")
        return None

# 使用示例
if __name__ == "__main__":
    base_image = "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream4_imageToimage.png"
    new_image = generate_image_from_image(
        prompt="生成狗狗趴在草地上的近景画面",
        base_image_url=base_image
    )
```

## 多图融合生成示例

豆包还支持多张图片融合生成，可以将多张参考图片的元素组合到一张新图片中：

```bash cURL - 多图融合 theme={null}
curl -X POST "https://api.tokenops.ai/v1/images/generations" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <API-KEY>" \
  -d '{
    "model": "doubao-seedream-4-0-250828",
    "prompt": "将图1的服装换为图2的服装",
    "image": [
      "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream4_imagesToimage_1.png",
      "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream4_imagesToimage_2.png"
    ],
    "sequential_image_generation": "disabled",
    "size": "1024x1024",
    "response_format": "url",
    "watermark": true
  }'
```

```python Python - 多图融合 theme={null}
import requests

API_KEY = "<API-KEY>"
BASE_URL = "https://api.tokenops.ai/v1"

def generate_image_from_multiple_images(prompt, image_urls, model="doubao-seedream-4-0-250828", size="1024x1024"):
    """
    基于多张图片融合生成新图片
    
    Args:
        prompt: 融合描述，如"将图1的服装换为图2的服装"
        image_urls: 参考图片URL列表
        model: 模型名称，支持多图融合的模型
        size: 输出图片尺寸
    """
    url = f"{BASE_URL}/images/generations"
    headers = {
        "Content-Type": "application/json",
        "Authorization": f"Bearer {API_KEY}"
    }
    
    data = {
        "model": model,
        "prompt": prompt,
        "image": image_urls,  # 传入图片URL数组
        "sequential_image_generation": "disabled",
        "size": size,
        "response_format": "url",
        "watermark": True
    }
    
    response = requests.post(url, headers=headers, json=data)
    
    if response.status_code == 200:
        result = response.json()
        print(f"多图融合生成时间: {result.get('created')}")
        
        if result.get('usage'):
            usage = result['usage']
            print(f"Token使用: 总计={usage.get('total_tokens')}, 输出={usage.get('output_tokens')}")
        
        for i, img_data in enumerate(result['data']):
            if 'url' in img_data:
                print(f"融合生成的图片URL: {img_data['url']}")
                return img_data['url']
    else:
        print(f"错误: {response.status_code} - {response.text}")
        return None

# 使用示例
if __name__ == "__main__":
    # 多图融合示例
    image_list = [
        "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream4_imagesToimage_1.png",
        "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream4_imagesToimage_2.png"
    ]
    
    fused_image = generate_image_from_multiple_images(
        prompt="将图1的服装换为图2的服装",
        image_urls=image_list
    )
    
    if fused_image:
        print("多图融合生成成功！")
```

### 多图融合功能说明

* **支持模型**: `doubao-seedream-4-0-250828`（专门支持多图融合）
* **输入格式**: `image` 参数接受图片URL数组，最多支持多张图片
* **提示词格式**: 可使用"图1"、"图2"等引用不同的输入图片
* **常见用途**: 服装替换、风格迁移、元素组合、场景融合
* **控制参数**: `sequential_image_generation` 设为 `"disabled"` 以启用融合模式

## 图生组图示例

基于多张参考图片生成一组相关图片，适用于需要生成多个相关场景的情况：

```bash cURL - 图生组图 theme={null}
curl -X POST "https://api.tokenops.ai/v1/images/generations" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <API-KEY>" \
  -d '{
    "prompt": "生成3张女孩和奶牛玩偶在游乐园开心地坐过山车的图片，涵盖早晨、中午、晚上",
    "image": [
      "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream4_imagesToimages_1.png",
      "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream4_imagesToimages_2.png"
    ],
    "model": "doubao-seedream-4-0-250828",
    "sequential_image_generation": "auto",
    "sequential_image_generation_options": {
      "max_images": 3
    },
    "size": "1024x1024",
    "response_format": "url",
    "watermark": true
  }'
```

```python Python - 图生组图 theme={null}
import requests

API_KEY = "<API-KEY>"
BASE_URL = "https://api.tokenops.ai/v1"

def generate_image_series_from_images(prompt, image_urls, max_images=3, model="doubao-seedream-4-0-250828"):
    """
    基于多张参考图片生成一组相关图片
    
    Args:
        prompt: 组图描述，可以包含多个场景要求
        image_urls: 参考图片URL列表
        max_images: 最大生成图片数量
        model: 模型名称
    """
    url = f"{BASE_URL}/images/generations"
    headers = {
        "Content-Type": "application/json",
        "Authorization": f"Bearer {API_KEY}"
    }
    
    data = {
        "prompt": prompt,
        "image": image_urls,
        "model": model,
        "sequential_image_generation": "auto",
        "sequential_image_generation_options": {
            "max_images": max_images
        },
        "size": "1024x1024",
        "response_format": "url",
        "watermark": True
    }
    
    response = requests.post(url, headers=headers, json=data)
    
    if response.status_code == 200:
        result = response.json()
        print(f"图生组图生成时间: {result.get('created')}")
        
        if result.get('usage'):
            usage = result['usage']
            print(f"Token使用: 总计={usage.get('total_tokens')}, 输出={usage.get('output_tokens')}")
        
        generated_images = []
        for i, img_data in enumerate(result['data']):
            if 'url' in img_data:
                print(f"生成的图片 {i+1}: {img_data['url']}")
                generated_images.append(img_data['url'])
        
        return generated_images
    else:
        print(f"错误: {response.status_code} - {response.text}")
        return None

# 使用示例
if __name__ == "__main__":
    # 图生组图示例
    reference_images = [
        "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream4_imagesToimages_1.png",
        "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream4_imagesToimages_2.png"
    ]
    
    image_series = generate_image_series_from_images(
        prompt="生成3张女孩和奶牛玩偶在游乐园开心地坐过山车的图片，涵盖早晨、中午、晚上",
        image_urls=reference_images,
        max_images=3
    )
    
    if image_series:
        print(f"成功生成 {len(image_series)} 张组图！")
```

### 图生组图功能说明

* **支持模型**: `doubao-seedream-4-0-250828`
* **组图模式**: `sequential_image_generation` 设为 `"auto"` 启用自动组图生成
* **数量控制**: 通过 `max_images` 参数控制生成图片数量（建议1-10张）
* **场景描述**: 提示词可以描述多个场景变化，如时间、天气、角度等
* **常见用途**: 故事板生成、时间序列图片、多角度展示、场景变化演示
* **输出特点**: 生成的多张图片保持风格一致性，同时体现描述中的变化

## 响应格式

```json theme={null}
{
  "created": 1762841059,
  "data": [
    {
      "url": "xxxxxx"
    }
  ],
  "usage": {
    "total_tokens": 4096,
    "output_tokens": 4096,
    "input_tokens_details": {}
  }
}
```

## 应用场景

### 创意设计

* **广告海报**: 商业宣传图片生成
* **产品包装**: 包装设计概念图
* **UI界面**: 应用图标和界面元素

### 内容创作

* **社交媒体**: 配图和封面设计
* **博客文章**: 文章插图和头图
* **视频缩略图**: 吸引眼球的封面图

### 艺术创作

* **数字艺术**: 各种风格的艺术作品
* **概念设计**: 游戏和影视概念图
* **插画绘本**: 故事插图和角色设计

## 最佳实践

### 提示词优化

```python theme={null}
# 好的提示词示例
good_prompts = [
    "一只橘色的小猫坐在窗台上，阳光透过窗户洒在它身上，温暖的光线，高画质，细节丰富",
    "现代简约风格的客厅，白色沙发，木质茶几，绿植装饰，自然光照，室内设计，高清摄影",
    "赛博朋克风格的未来城市，霓虹灯闪烁，高楼大厦，雨夜场景，电影级画质，科幻氛围."
]

# 避免的提示词
avoid_prompts = [
    "猫",  # 太简单
    "漂亮的图片",  # 太模糊
    "随便画点什么"  # 没有具体指导.
]
```

### 参数调优建议

```python theme={null}
# 不同场景的推荐参数
scenarios = {
    "写实摄影": {
        "size": "1024x1024",
        "watermark": True
    },
    "艺术创作": {
        "size": "1024x1024",
        "optimize_prompt_options": {"enable": True}
    },
    "快速原型": {
        "size": "512x512",
        "watermark": False
    }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.