image-outpainting について
image-outpainting は、each::sense で画像の境界外を生成するスキルです。方向指定の拡張やアスペクト比の変更に対応し、プロンプトやセッションで生成領域を調整できます。
主な機能
- 01画像の水平・垂直方向への拡張
- 02アスペクト比の変換
- 03背景拡張とトリミング範囲の復元
- 04パノラマ構図の作成
- 05プロンプトによる拡張内容の指定
- 06セッションでの段階的な調整
活用シーン
- 01ポートレート写真を16:9に調整
- 02商品写真をバナー向けに拡張
- 03トリミングされた写真の範囲を広げる
- 04風景画像からパノラマを作成
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ eachlabs/ skills --skill image-outpaintingインストール後、Claude Code で/image-outpaintingを入力して読み込まれたか確認します。
同梱ファイルreferences/SSE-EVENTS.md
詳細
画像のアウトペイント/拡張
each::sense を使って、画像を元の境界の外側まで拡張します。このスキルでは、AI が元の画像と自然になじむ新しいコンテンツを生成するため、アスペクト比の変換、背景の拡張、画像の創造的な拡張が可能です。
機能
- 横方向の拡張:画像の左右を広げ、横長の構図にします
- 縦方向の拡張:画像の上下にコンテンツを追加し、縦長にします
- アスペクト比の変換:縦向きの画像を横向きに、またはその逆に変換します
- 背景の拡張:写真に周囲の状況や環境を追加します
- 切り抜きの復元:元のフレームの外側にあるコンテンツを復元または想像で補います
- パノラマの作成:1枚の画像を横長のパノラマビューにします
- 商品写真の強化:バナーや広告用に商品写真を拡張します
- アートワークの拡張:イラストやデジタルアートを拡張します
クイックスタート
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"
}'
よくあるアウトペイントのシナリオ
| 用途 | 目標比率 | 説明 |
|---|---|---|
| 縦向きから横向きへ | 16:9 | 縦向きの写真を動画/デスクトップ用に変換 |
| 正方形からワイドスクリーンへ | 21:9 | 映画のような構図を作成 |
| 商品バナー | 3:1 または 4:1 | ウェブバナー用に商品写真を拡張 |
| ソーシャルメディア | 4:5 または 1:1 | Instagram フィード向けに最適化 |
| パノラマ | 2:1 または 3:1 | 横長の風景ビューを作成 |
| フルブリード | カスタム | 印刷用の余白を追加 |
使用例
1. 画像を横方向に拡張する
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. 画像を縦方向に拡張する
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. 縦向きの画像を横向きに変換する
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. 正方形の画像をワイドスクリーンに変換する
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. バナー用に商品写真を拡張する
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. 背景や周囲の状況を追加する
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. 切り抜かれた写真を復元する
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. 1枚の画像からパノラマを作成する
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. アートワークやイラストを拡張する
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. ポートレートに周囲の環境を追加する
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"
}'
複数ターンのアウトペイントセッション
session_id を使って、アウトペイントの結果を反復調整できます。
# 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"
}'
# 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"
}'
# 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"
}'
アウトペイント用プロンプトのヒント
画像の拡張を依頼するときは、プロンプトに以下の詳細を含めてください。
- 方向:横方向、縦方向、または全方向を指定します
- 目標比率:希望するアスペクト比(16:9、21:9、3:1 など)を指定します
- コンテンツの指示:拡張する領域に表示する内容を説明します
- スタイルの一致:照明、色、雰囲気を統一するよう指定します
- 被写体の位置:元の被写体を配置する位置を指定します
- 用途:バナー、ソーシャルメディア、印刷用などの用途を伝えます
プロンプトの例
"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]."
モードの選択
生成を始める前に、ユーザーに尋ねてください。
「高速で低コストにしますか? それとも高品質にしますか?」
| モード | 最適な用途 | 速度 | 品質 |
|---|---|---|---|
max | 最終出力、プロ用途、複雑なシーン | 遅い | 最高 |
eco | クイックプレビュー、構図のテスト、反復 | 速い | 良好 |
ベストプラクティス
最良の結果を得るには
- 高品質なソース:高解像度の元画像から始めます
- 明確な輪郭:輪郭がはっきりした画像は、より自然にアウトペイントできます
- 統一された照明:よりよく一致させるため、プロンプトで照明を説明します
- 適切な拡張範囲:元画像の2~3倍までの拡張が最適です
- 反復調整:セッションを使い、段階的に結果を調整します
避けるべきよくある落とし穴
- 一度に大きく拡張せず、段階的に行ってください
- 端に複雑な前景要素がある画像の拡張は避けてください
- 極端に様式化された画像や抽象的な画像では、完璧な結果を期待しないでください
- 拡張する領域に表示する内容を具体的に指定してください
アスペクト比の一覧
| 名前 | 比率 | 主な用途 |
|---|---|---|
| 正方形 | 1:1 | Instagram、サムネイル |
| 標準写真 | 4:3 | 従来の写真撮影 |
| Instagram のポートレート | 4:5 | Instagram のフィード |
| HD 動画 | 16:9 | YouTube、プレゼンテーション |
| シネマティック | 21:9 | 映画、ウルトラワイドモニター |
| パノラマ | 2:1, 3:1 | 風景、バナー |
| バナー | 4:1, 5:1 | Web サイトのヘッダー、広告 |
エラー処理
| エラー | 原因 | 解決策 |
|---|---|---|
Failed to create prediction: HTTP 422 | 残高不足 | eachlabs.ai でチャージします |
| コンテンツポリシー違反 | 禁止されているコンテンツ | コンテンツポリシーに準拠するようプロンプトを調整します |
| タイムアウト | 複雑な生成処理 | クライアントのタイムアウトを最低 10 分に設定します |
| エッジのブレンドが不自然 | 元画像の品質が低い | より高解像度の元画像を使用します |
関連スキル
each-sense- コア API ドキュメントimage-inpainting- 画像内の特定の領域を編集しますimage-upscaling- 画像の解像度を高めますbackground-removal- 背景を削除して置き換えます
コメント
Markdown 対応