image-outpainting

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Image Outpainting / Extension

图像扩图/边界扩展

Extend images beyond their original boundaries using each::sense. This skill uses AI to intelligently generate new content that seamlessly blends with the original image, enabling aspect ratio conversions, background expansion, and creative image extensions.
借助each::sense扩展图像边界。该技能利用AI智能生成与原图无缝融合的新内容,支持宽高比转换、背景扩展以及创意性图像延伸。

Features

功能特性

  • Horizontal Extension: Expand images left and right for wider compositions
  • Vertical Extension: Add content above and below for taller images
  • Aspect Ratio Conversion: Transform portrait to landscape or vice versa
  • Background Expansion: Add more context and environment to photos
  • Uncropping: Recover or imagine content outside the original frame
  • Panoramic Creation: Turn single images into wide panoramic views
  • Product Photo Enhancement: Extend product shots for banners and ads
  • Artwork Extension: Expand illustrations and digital art
  • 横向扩展:向左右扩展图像,打造更宽的构图
  • 纵向扩展:在图像上下方添加内容,生成更高的图像
  • 宽高比转换:在竖版与横版格式间相互转换
  • 背景扩展:为照片添加更多场景环境信息
  • 还原裁剪:恢复或生成原图裁剪区域外的内容
  • 全景图创建:将单张图像转换为宽幅全景视图
  • 产品照片增强:扩展产品照片以适配横幅和广告需求
  • 艺术品延伸:扩展插画与数字艺术作品

Quick Start

快速开始

bash
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Extend this image horizontally to create a wider 16:9 composition, maintaining the same style and lighting"}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/original-photo.jpg"],
    "mode": "max"
  }'
bash
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Extend this image horizontally to create a wider 16:9 composition, maintaining the same style and lighting"}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/original-photo.jpg"],
    "mode": "max"
  }'

Common Outpainting Scenarios

常见扩图场景

Use CaseTarget RatioDescription
Portrait to Landscape16:9Convert vertical photos for video/desktop
Square to Widescreen21:9Create cinematic compositions
Product Banner3:1 or 4:1Extend product shots for web banners
Social Media4:5 or 1:1Optimize for Instagram feed
Panoramic2:1 or 3:1Create wide scenic views
Full BleedCustomAdd margins for printing
使用场景目标宽高比描述
竖转横16:9将竖版照片转换为适配视频/桌面的格式
方转宽屏21:9创建电影级构图
产品横幅3:1 或 4:1扩展产品照片以适配网页横幅
社交媒体4:5 或 1:1优化以适配Instagram动态
全景图2:1 或 3:1创建宽幅风景视图
满版输出自定义添加打印所需边距

Use Case Examples

场景示例

1. Extend Image Horizontally

1. 横向扩展图像

bash
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Extend this image horizontally on both sides. Add more of the natural environment while keeping the subject centered. Maintain consistent lighting, color grading, and style throughout the extension."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/landscape-photo.jpg"],
    "mode": "max"
  }'
bash
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Extend this image horizontally on both sides. Add more of the natural environment while keeping the subject centered. Maintain consistent lighting, color grading, and style throughout the extension."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/landscape-photo.jpg"],
    "mode": "max"
  }'

2. Extend Image Vertically

2. 纵向扩展图像

bash
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Extend this image vertically - add more sky above and more ground/foreground below. Keep the horizon line natural and maintain the same atmosphere and time of day."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/landscape.jpg"],
    "mode": "max"
  }'
bash
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Extend this image vertically - add more sky above and more ground/foreground below. Keep the horizon line natural and maintain the same atmosphere and time of day."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/landscape.jpg"],
    "mode": "max"
  }'

3. Convert Portrait to Landscape

3. 竖版人像转横版风景

bash
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Convert this vertical portrait photo to a horizontal 16:9 landscape format. Extend the background on both sides to create a wider scene. Keep the person as the main subject and ensure the extended areas match the original environment perfectly."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/portrait-photo.jpg"],
    "mode": "max"
  }'
bash
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Convert this vertical portrait photo to a horizontal 16:9 landscape format. Extend the background on both sides to create a wider scene. Keep the person as the main subject and ensure the extended areas match the original environment perfectly."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/portrait-photo.jpg"],
    "mode": "max"
  }'

4. Convert Square to Widescreen

4. 方形转宽屏

bash
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Transform this square 1:1 image into a cinematic 21:9 widescreen format. Extend the scene horizontally while preserving the central composition. Match the lighting, textures, and visual style seamlessly."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/square-image.jpg"],
    "mode": "max"
  }'
bash
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Transform this square 1:1 image into a cinematic 21:9 widescreen format. Extend the scene horizontally while preserving the central composition. Match the lighting, textures, and visual style seamlessly."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/square-image.jpg"],
    "mode": "max"
  }'

5. Extend Product Photo for Banner

5. 扩展产品照片以适配横幅

bash
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Extend this product photo into a wide banner format (approximately 4:1 ratio). Keep the product on the left third of the image and extend the clean background to the right to create space for text overlay. Maintain the same studio lighting and surface texture."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/product-shot.jpg"],
    "mode": "max"
  }'
bash
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Extend this product photo into a wide banner format (approximately 4:1 ratio). Keep the product on the left third of the image and extend the clean background to the right to create space for text overlay. Maintain the same studio lighting and surface texture."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/product-shot.jpg"],
    "mode": "max"
  }'

6. Add More Background/Context

6. 添加更多背景/场景信息

bash
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Expand this image in all directions to add more environmental context. The subject is too tightly cropped - extend the scene to show more of the surroundings, making it feel less cramped. Keep the original subject size and add approximately 50% more space around it."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/tight-crop.jpg"],
    "mode": "max"
  }'
bash
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Expand this image in all directions to add more environmental context. The subject is too tightly cropped - extend the scene to show more of the surroundings, making it feel less cramped. Keep the original subject size and add approximately 50% more space around it."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/tight-crop.jpg"],
    "mode": "max"
  }'

7. Uncrop a Cropped Photo

7. 还原裁剪照片

bash
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "This photo has been tightly cropped - uncrop it to reveal more of the scene. Extend downward to show the full body (currently cut off at the waist) and extend the sides to show more of the room interior. Generate realistic content that matches the existing style."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/cropped-photo.jpg"],
    "mode": "max"
  }'
bash
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "This photo has been tightly cropped - uncrop it to reveal more of the scene. Extend downward to show the full body (currently cut off at the waist) and extend the sides to show more of the room interior. Generate realistic content that matches the existing style."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/cropped-photo.jpg"],
    "mode": "max"
  }'

8. Create Panoramic from Single Image

8. 单图生成全景图

bash
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Transform this landscape photo into a wide panoramic image with a 3:1 aspect ratio. Extend the scenic view on both left and right sides, continuing the mountain range, sky, and terrain naturally. Create a sweeping vista that feels like a real panoramic photograph."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/mountain-view.jpg"],
    "mode": "max"
  }'
bash
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Transform this landscape photo into a wide panoramic image with a 3:1 aspect ratio. Extend the scenic view on both left and right sides, continuing the mountain range, sky, and terrain naturally. Create a sweeping vista that feels like a real panoramic photograph."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/mountain-view.jpg"],
    "mode": "max"
  }'

9. Extend Artwork/Illustration

9. 延伸艺术品/插画

bash
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Extend this digital illustration horizontally to double its width. Continue the artistic style, color palette, and visual elements seamlessly. This is a fantasy landscape illustration - extend the magical forest and atmospheric elements on both sides while maintaining the same painting technique and mood."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/fantasy-illustration.jpg"],
    "mode": "max"
  }'
bash
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Extend this digital illustration horizontally to double its width. Continue the artistic style, color palette, and visual elements seamlessly. This is a fantasy landscape illustration - extend the magical forest and atmospheric elements on both sides while maintaining the same painting technique and mood."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/fantasy-illustration.jpg"],
    "mode": "max"
  }'

10. Add Environment to Portrait

10. 为人像添加场景

bash
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "This is a headshot with a blurred background. Extend the image to show more of the environment - convert to a 3/4 or full body shot by extending downward, and widen the scene to show the cafe/office setting implied by the background. Keep the portrait style and depth of field consistent."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/headshot.jpg"],
    "mode": "max"
  }'
bash
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "This is a headshot with a blurred background. Extend the image to show more of the environment - convert to a 3/4 or full body shot by extending downward, and widen the scene to show the cafe/office setting implied by the background. Keep the portrait style and depth of field consistent."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/headshot.jpg"],
    "mode": "max"
  }'

Multi-Turn Outpainting Session

多轮扩图会话

Use
session_id
to iterate on outpainting results:
bash
undefined
使用
session_id
迭代优化扩图结果:
bash
undefined

Initial extension request

初始扩展请求

curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions
-H "Content-Type: application/json"
-H "X-API-Key: $EACHLABS_API_KEY"
-H "Accept: text/event-stream"
-d '{ "messages": [{"role": "user", "content": "Extend this beach photo horizontally to create a wider 16:9 composition"}], "model": "eachsense/beta", "stream": true, "image_urls": ["https://example.com/beach.jpg"], "session_id": "outpaint-beach-001", "mode": "max" }'
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions
-H "Content-Type: application/json"
-H "X-API-Key: $EACHLABS_API_KEY"
-H "Accept: text/event-stream"
-d '{ "messages": [{"role": "user", "content": "Extend this beach photo horizontally to create a wider 16:9 composition"}], "model": "eachsense/beta", "stream": true, "image_urls": ["https://example.com/beach.jpg"], "session_id": "outpaint-beach-001", "mode": "max" }'

Request adjustments

请求调整

curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions
-H "Content-Type: application/json"
-H "X-API-Key: $EACHLABS_API_KEY"
-H "Accept: text/event-stream"
-d '{ "messages": [{"role": "user", "content": "The right side extension looks good, but can you add some palm trees on the left side to balance the composition?"}], "model": "eachsense/beta", "stream": true, "session_id": "outpaint-beach-001" }'
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions
-H "Content-Type: application/json"
-H "X-API-Key: $EACHLABS_API_KEY"
-H "Accept: text/event-stream"
-d '{ "messages": [{"role": "user", "content": "The right side extension looks good, but can you add some palm trees on the left side to balance the composition?"}], "model": "eachsense/beta", "stream": true, "session_id": "outpaint-beach-001" }'

Further refinement

进一步优化

curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions
-H "Content-Type: application/json"
-H "X-API-Key: $EACHLABS_API_KEY"
-H "Accept: text/event-stream"
-d '{ "messages": [{"role": "user", "content": "Now extend it vertically as well - add more dramatic sky with sunset clouds above"}], "model": "eachsense/beta", "stream": true, "session_id": "outpaint-beach-001" }'
undefined
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions
-H "Content-Type: application/json"
-H "X-API-Key: $EACHLABS_API_KEY"
-H "Accept: text/event-stream"
-d '{ "messages": [{"role": "user", "content": "Now extend it vertically as well - add more dramatic sky with sunset clouds above"}], "model": "eachsense/beta", "stream": true, "session_id": "outpaint-beach-001" }'
undefined

Prompt Tips for Outpainting

扩图提示词技巧

When requesting image extensions, include these details in your prompt:
  1. Direction: Specify horizontal, vertical, or all directions
  2. Target Ratio: Mention the desired aspect ratio (16:9, 21:9, 3:1, etc.)
  3. Content Guidance: Describe what should appear in extended areas
  4. Style Matching: Request consistent lighting, colors, and atmosphere
  5. Subject Position: Specify where the original subject should be placed
  6. Use Case: Mention if it's for a banner, social media, print, etc.
请求图像扩展时,提示词中应包含以下细节:
  1. 方向:指定横向、纵向或全方向
  2. 目标宽高比:说明期望的宽高比(16:9、21:9、3:1等)
  3. 内容指引:描述扩展区域应添加的内容
  4. 风格匹配:要求保持一致的光线、色彩和氛围
  5. 主体位置:指定原图主体的摆放位置
  6. 使用场景:说明是用于横幅、社交媒体、印刷品等

Example Prompt Structure

提示词结构示例

"Extend this [image type] [direction] to [target ratio/size].
[Describe what to add in extended areas].
Maintain [lighting/style/atmosphere] consistency.
Position the original [subject] in the [location]."
"将这张[图像类型]向[方向]扩展至[目标宽高比/尺寸]。
[描述扩展区域需添加的内容]。
保持[光线/风格/氛围]一致性。
将原图[主体]放置在[位置]。"

Mode Selection

模式选择

Ask your users before generating:
"Do you want fast & cheap, or high quality?"
ModeBest ForSpeedQuality
max
Final outputs, professional use, complex scenesSlowerHighest
eco
Quick previews, testing compositions, iterationsFasterGood
生成前请询问用户:
"您需要快速低成本的结果,还是高质量的结果?"
模式适用场景速度质量
max
最终输出、专业用途、复杂场景较慢最高
eco
快速预览、测试构图、迭代优化较快良好

Best Practices

最佳实践

For Best Results

获得最佳结果的建议

  • High-quality source: Start with a high-resolution original image
  • Clear edges: Images with distinct edges outpaint more seamlessly
  • Consistent lighting: Describe the lighting in your prompt for better matching
  • Reasonable extensions: Extending 2-3x the original size works best
  • Iterate: Use sessions to refine results progressively
  • 高质量原图:以高分辨率原图为基础
  • 清晰边缘:边缘清晰的图像扩图效果更自然
  • 明确光线描述:在提示词中说明光线情况以获得更好的匹配效果
  • 合理扩展范围:扩展至原图的2-3倍效果最佳
  • 迭代优化:使用会话功能逐步优化结果

Common Pitfalls to Avoid

需避免的常见误区

  • Don't extend too far in one step - do it gradually
  • Avoid extending images with complex foreground elements at edges
  • Don't expect perfect results with heavily stylized or abstract images
  • Be specific about what should appear in extended areas
  • 不要单次扩展过大范围,应逐步进行
  • 避免扩展边缘有复杂前景元素的图像
  • 不要对高度风格化或抽象图像期望完美结果
  • 明确说明扩展区域应添加的内容

Aspect Ratio Reference

宽高比参考

NameRatioCommon Use
Square1:1Instagram, thumbnails
Standard Photo4:3Traditional photography
Instagram Portrait4:5Instagram feed
HD Video16:9YouTube, presentations
Cinematic21:9Film, ultrawide monitors
Panoramic2:1, 3:1Scenic views, banners
Banner4:1, 5:1Website headers, ads
名称比例常见用途
方形1:1Instagram、缩略图
标准照片4:3传统摄影
Instagram竖版4:5Instagram动态
高清视频16:9YouTube、演示文稿
电影级21:9电影、超宽屏显示器
全景图2:1、3:1风景视图、横幅
横幅4:1、5:1网页头部、广告

Error Handling

错误处理

ErrorCauseSolution
Failed to create prediction: HTTP 422
Insufficient balanceTop up at eachlabs.ai
Content policy violationProhibited contentAdjust prompt to comply with content policies
TimeoutComplex generationSet client timeout to minimum 10 minutes
Poor edge blendingLow quality sourceUse higher resolution source image
错误原因解决方案
Failed to create prediction: HTTP 422
余额不足在eachlabs.ai充值
内容政策违规包含违禁内容调整提示词以符合内容政策
超时生成任务复杂将客户端超时设置为至少10分钟
边缘融合效果差原图质量低使用更高分辨率的原图

Related Skills

相关技能

  • each-sense
    - Core API documentation
  • image-inpainting
    - Edit specific regions within images
  • image-upscaling
    - Enhance image resolution
  • background-removal
    - Remove and replace backgrounds
  • each-sense
    - 核心API文档
  • image-inpainting
    - 编辑图像内特定区域
  • image-upscaling
    - 提升图像分辨率
  • background-removal
    - 移除并替换背景