Stable Image Ultra
Generate the highest quality images on AWS Bedrock via Stability AI models.
Models
| Model | ID | Strength | Price |
|---|
| Stable Image Ultra 1.1 | INLINECODE0 | Photorealism, luxury, fine detail | ~$0.08/img |
| SD 3.5 Large |
stability.sd3-5-large-v1:0 | Creative diversity, prompt adherence | ~$0.06/img |
Default: Stable Image Ultra (highest quality).
AWS Auth Methods
| Method | How to Use |
|---|
| Bearer token | INLINECODE2 env var or INLINECODE3 |
| Environment variables |
Set
AWS_ACCESS_KEY_ID +
AWS_SECRET_ACCESS_KEY |
|
Credentials file | Configure
~/.aws/credentials |
|
Named profile |
--profile my-profile or
AWS_PROFILE env var |
|
Direct keys |
--access-key AKIA... --secret-key ... |
|
Temporary credentials | Add
--session-token with direct keys |
|
IAM instance role | Auto-detected on EC2/ECS/Lambda |
|
AWS SSO | Run
aws sso login first |
Auto-detection order: direct keys → profile → bearer token → env vars → credentials file → instance role → SSO.
Quick Start
CODEBLOCK0
Parameters
| Flag | Default | Description |
|---|
| INLINECODE12 | — | Text description of the image (max 10,000 chars) |
| INLINECODE13 |
output.png | Output file path |
|
-m, --model |
ultra | Model:
ultra or
sd35 |
|
-n, --count | 1 | Number of images (1-5) |
|
--negative | — | Negative prompt (what to avoid) |
|
--seed | random | Seed for reproducibility |
|
--region | us-west-2 | AWS region (Stability AI models require us-west-2) |
|
--profile | — | AWS named profile |
|
--access-key | — | AWS Access Key ID |
|
--secret-key | — | AWS Secret Access Key |
|
--session-token | — | AWS Session Token |
|
--bearer-token | — | Bearer token (overrides env) |
Workflow
- 1. Craft a detailed English prompt (Stability AI models perform best in English).
- Choose model:
ultra for photorealism, sd35 for creative/artistic. - Run
generate.py with timeout=120. - Send resulting image to user via
message tool.
Prompt Tips
- - Detailed English prompts yield best results.
- Specify style: "photorealistic", "oil painting", "watercolor", "3D render", "anime".
- Use
--negative "blurry, low quality, text, watermark" to exclude unwanted elements. - Stable Image Ultra excels at: photorealism, luxury brands, fine textures, dynamic lighting.
- SD 3.5 Large excels at: diverse styles, complex compositions, typography, prompt following.
Important Notes
- - Region: Both models are available ONLY in
us-west-2 (Oregon). The script defaults to this region. - Pricing: Ultra ~$0.08/image, SD3.5 Large ~$0.06/image.
- API: Very simple — request is just
{"prompt": "..."}, response contains base64 images. - For standard/budget images ($0.04/image), use the
nova-canvas skill instead.
Stable Image Ultra
通过Stability AI模型在AWS Bedrock上生成最高质量的图像。
模型
| 模型 | ID | 优势 | 价格 |
|---|
| Stable Image Ultra 1.1 | stability.stable-image-ultra-v1:1 | 照片级真实感、奢华质感、精细细节 | ~$0.08/张 |
| SD 3.5 Large |
stability.sd3-5-large-v1:0 | 创意多样性、提示词遵循度 | ~$0.06/张 |
默认:Stable Image Ultra(最高质量)。
AWS认证方式
| 方法 | 使用方式 |
|---|
| Bearer令牌 | AWSBEARERTOKENBEDROCK环境变量或--bearer-token |
| 环境变量 |
设置AWSACCESS
KEYID + AWS
SECRETACCESS_KEY |
|
凭证文件 | 配置~/.aws/credentials |
|
命名配置文件 | --profile my-profile或AWS_PROFILE环境变量 |
|
直接密钥 | --access-key AKIA... --secret-key ... |
|
临时凭证 | 配合直接密钥添加--session-token |
|
IAM实例角色 | 在EC2/ECS/Lambda上自动检测 |
|
AWS SSO | 先运行aws sso login |
自动检测顺序:直接密钥 → 配置文件 → bearer令牌 → 环境变量 → 凭证文件 → 实例角色 → SSO。
快速开始
bash
Stable Image Ultra(默认,最高质量)
python3 {baseDir}/scripts/generate.py 你的提示词 -o output.png
Stable Diffusion 3.5 Large
python3 {baseDir}/scripts/generate.py 你的提示词 -o output.png --model sd35
带负面提示词
python3 {baseDir}/scripts/generate.py 你的提示词 -o output.png --negative 模糊,低质量
指定认证方式
python3 {baseDir}/scripts/generate.py 你的提示词 -o output.png --profile work
参数
| 标志 | 默认值 | 描述 |
|---|
| prompt | — | 图像的文本描述(最多10,000字符) |
| -o, --output |
output.png | 输出文件路径 |
| -m, --model | ultra | 模型:ultra或sd35 |
| -n, --count | 1 | 图像数量(1-5) |
| --negative | — | 负面提示词(要避免的内容) |
| --seed | 随机 | 用于可重复性的种子值 |
| --region | us-west-2 | AWS区域(Stability AI模型要求us-west-2) |
| --profile | — | AWS命名配置文件 |
| --access-key | — | AWS访问密钥ID |
| --secret-key | — | AWS秘密访问密钥 |
| --session-token | — | AWS会话令牌 |
| --bearer-token | — | Bearer令牌(覆盖环境变量) |
工作流程
- 1. 编写详细的英文提示词(Stability AI模型在英文下表现最佳)。
- 选择模型:ultra用于照片级真实感,sd35用于创意/艺术风格。
- 使用timeout=120运行generate.py。
- 通过message工具将生成的图像发送给用户。
提示词技巧
- - 详细的英文提示词能获得最佳效果。
- 指定风格:photorealistic(照片级真实感)、oil painting(油画)、watercolor(水彩)、3D render(3D渲染)、anime(动漫)。
- 使用--negative blurry, low quality, text, watermark排除不需要的元素。
- Stable Image Ultra擅长:照片级真实感、奢侈品牌、精细纹理、动态光照。
- SD 3.5 Large擅长:多样化风格、复杂构图、文字排版、提示词遵循。
重要说明
- - 区域:两个模型仅在us-west-2(俄勒冈)可用。脚本默认使用此区域。
- 定价:Ultra约$0.08/张,SD3.5 Large约$0.06/张。
- API:非常简单——请求仅为{prompt: ...},响应包含base64编码的图像。
- 对于标准/经济型图像($0.04/张),请改用nova-canvas技能。