公開テスト結果なし
商品デザインの保持
形状、比率、色、ロゴ、パッケージ上の文字に意図しない変化がないかを確認します。
モデルガイド
gemini-3.1-flash-image
日常の生成と編集に適した、複数サイズ・比率を持つバランス型ルートです。
以下は YingTu で現在利用できる設定です。
A clean product photo of a matte ceramic coffee mug on a light stone table, soft window light, natural shadows, minimal styling.
An editorial travel photograph of a mountain lake at sunrise, layered atmospheric depth, natural color, fine detail.
Preserve the main subject and composition. Replace the background with a quiet modern studio using soft directional daylight.
以下は画像スタジオで現在利用できる設定です。
画像スタジオと同じリクエスト形式を使った例です。
import base64
import mimetypes
import os
import sys
import requests
API_KEY = os.environ.get("LAOZHANG_API_KEY")
if not API_KEY:
raise RuntimeError("Set the LAOZHANG_API_KEY environment variable before running this example.")
API_URL = "https://api2.laozhang.ai/v1beta/models/gemini-3.1-flash-image:generateContent"
REQUEST_TIMEOUT_SECONDS = 500
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
}
payload = {
"contents": [{
"parts": [
{"text": "A clean product photo of a matte ceramic coffee mug on a light stone table, soft window light, natural shadows, minimal styling."}
]
}],
"generationConfig": {
"responseModalities": ["IMAGE"],
"imageConfig": {
"imageSize": "2K"
}
}
}
try:
response = requests.post(
API_URL,
headers=headers,
json=payload,
timeout=REQUEST_TIMEOUT_SECONDS,
)
except requests.Timeout as error:
print(
"Request timed out after 500 seconds. The result status may be unknown; "
"check call and billing logs before retrying.",
file=sys.stderr,
)
raise SystemExit(1) from error
if response.status_code != 200:
print(f"API error {response.status_code}: {response.text}", file=sys.stderr)
raise SystemExit(1)
try:
result = response.json()
except ValueError as error:
print("API returned a non-JSON response.", file=sys.stderr)
raise SystemExit(1) from error
if not isinstance(result, dict):
print("API returned an unexpected JSON shape.", file=sys.stderr)
raise SystemExit(1)
image_part = None
for candidate in result.get("candidates", []):
for part in candidate.get("content", {}).get("parts", []):
inline_data = part.get("inlineData") or part.get("inline_data")
if inline_data and inline_data.get("data"):
image_part = inline_data
break
if image_part:
break
if not image_part:
response_id = result.get("responseId", "not provided")
print(f"No image data in response. responseId={response_id}", file=sys.stderr)
raise SystemExit(1)
mime_type = image_part.get("mimeType") or image_part.get("mime_type") or "image/png"
encoded_image = image_part["data"]
if encoded_image.startswith("data:"):
header, encoded_image = encoded_image.split(",", 1)
mime_type = header[5:].split(";", 1)[0] or mime_type
extension_by_mime = {
"image/jpeg": "jpg",
"image/png": "png",
"image/webp": "webp",
"image/gif": "gif",
}
extension = extension_by_mime.get(mime_type, "bin")
output_path = f"output.{extension}"
with open(output_path, "wb") as output_file:
output_file.write(base64.b64decode(encoded_image, validate=True))
print(f"Image saved: {output_path} ({mime_type})")
これらの画像には生成時のモデルとプロンプトが記録されていません。視覚例であり、モデルのテスト結果ではありません。



テスト記録
ここには、テスト条件と生成結果を確認できる形で公開した YingTu の記録だけを掲載します。未公開の記録は表示しません。
形状、比率、色、ロゴ、パッケージ上の文字に意図しない変化がないかを確認します。
被写体が保たれているか、輪郭が崩れていないか、指定した背景になっているかを確認します。