Generate the highest quality images on AWS Bedrock via Stability AI models.
| Model | ID | Strength | Price |
|---|---|---|---|
| ------- | ----- | --------- | ------- |
| Stable Image Ultra 1.1 | stability.stable-image-ultra-v1:1 | Photorealism, luxury, fine detail, skin texture | ~$0.08/img |
| SD 3.5 Large | stability.sd3-5-large-v1:0 | Creative diversity, prompt adherence, typography | ~$0.06/img |
Default: Stable Image Ultra(最高画质)。
所有生图任务默认最高画质,不限成本。
| Method | How to Use |
|---|---|
| -------- | ------------ |
| Bearer token | AWS_BEARER_TOKEN_BEDROCK env var or --bearer-token |
| 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.
# 最高画质(默认)
python3 {baseDir}/scripts/generate.py "detailed English prompt" -o output.png --negative "blurry, low quality, artifacts"
# 指定比例
python3 {baseDir}/scripts/generate.py "prompt" -o output.png --aspect-ratio 16:9 --negative "blurry, low quality"
# SD 3.5 Large(创意多样性)
python3 {baseDir}/scripts/generate.py "prompt" -o output.png --model sd35 --negative "blurry, low quality"
| Flag | Default | Description |
|---|---|---|
| ------ | --------- | ------------- |
prompt | — | Text description of the image (max 10,000 chars) |
-o, --output | 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) — 必填 |
--aspect-ratio | 1:1 | Aspect ratio: 1:1, 16:9, 21:9, 2:3, 3:2, 4:5, 5:4, 9:16, 9:21 |
--seed | random | Seed for reproducibility |
--region | us-west-2 | AWS region (Stability AI models require us-west-2) |
blurry, low quality, watermark, text, logo, artifacts, noise, grain, pixelated, distorted, oversaturated, cartoon, anime, illustration, ugly, deformed
Ultra-sharp professional corporate headshot portrait photograph of a [年龄 性别 种族] [职业],
wearing [服装细节:面料、颜色、配饰],
[表情:warm confident smile / serious determined look],
photographed with 85mm f/1.4 portrait lens creating beautiful bokeh,
three-point studio lighting setup with key light at 45 degrees,
clean [背景颜色] studio backdrop,
shot from [构图:chest up / full body / three-quarter],
ultra high resolution 8K quality, skin detail like a magazine cover,
Hasselblad medium format camera quality
负面:cartoon, anime, illustration, painting, blurry, soft focus, distorted face, extra fingers, low quality, watermark, text, noise, grain, oversaturated, plastic skin, uncanny valley, artificial looking
Breathtaking [视角:aerial view / panoramic / eye-level] of [具体场景],
[季节/时间:autumn forest, morning fog, golden hour sunlight],
[天气/氛围:dramatic clouds, mist in valleys, sun rays breaking through],
ultra detailed landscape photography, shot with [镜头:wide angle 14mm / telephoto 200mm],
National Geographic quality, vibrant natural colors, sharp focus throughout,
[画面层次:foreground detail, middle ground subject, background depth]
负面:blurry, low quality, watermark, text, artificial, oversaturated, flat lighting, dull colors, haze, smog
Professional product photography of [产品],
[材质细节:brushed aluminum, matte ceramic, polished wood grain],
on [表面:marble countertop / dark slate / white seamless],
[光线:soft diffused studio lighting with subtle reflections],
sharp focus on product, shallow depth of field background blur,
commercial advertising quality, 8K resolution,
shot with Phase One IQ4 150MP medium format camera
负面:blurry, low quality, watermark, text, cheap looking, plastic, artificial, flat lighting, harsh shadows
[具体场景描述,用隐喻和具象化],
[艺术风格:watercolor / isometric / flat illustration / pop art / paper craft],
[配色方案:warm earth tones / pastel palette / vibrant saturated],
[细节:intricate details, fine textures, visible brushstrokes],
professional digital art, trending on ArtStation,
cinematic composition, dramatic lighting
负面:blurry, low quality, watermark, text, ugly, amateur, generic, stock photo, clipart
| 场景 | 推荐比例 |
|---|---|
| ------ | --------- |
| 头像/头图 | 1:1 |
| 博客配图/Banner | 16:9 |
| 电影级场景 | 21:9 |
| 手机壁纸/海报 | 9:16 |
| 证件照/肖像 | 2:3 或 4:5 |
| 风景/横幅 | 3:2 或 16:9 |
生图过程耗时较长(15-60s),必须用 subagent 异步执行,避免阻塞主对话。
sessions_spawn({
task: `使用 stable-image-ultra 生图:
## 要求
- Prompt: "<英文 prompt>"
- Negative: "<negative prompt>"
- Output: <输出路径>
- Aspect Ratio: <比例>
## 完成后
生成完毕后,报告文件路径、分辨率和文件大小。`,
label: "生图-<简述>",
runTimeoutSeconds: 180
})
// 派发后必须 yield 等待结果
sessions_yield({ message: "等待生图完成" })
subagent 返回后,由调用方负责将图片发送给用户(根据当前 channel 选择合适方式)。
generate.py(runTimeoutSeconds=180)us-west-2 (Oregon) 可用--force-document 避免压缩,其他渠道按需处理)共 2 个版本