mcpField
F
Food Photography Generation

Food Photography Generation

github.com/eachlabs创意与媒体44241 次安装今天更新
代码仓库

关于 Food Photography Generation

介绍如何通过 each::sense API 根据文本提示词生成美食摄影图像,适用于菜单、博客、外卖列表和社交内容。内容涵盖视觉风格、提示词要素、生成模式及基于会话的菜单风格延续。

主要功能

  1. 01根据提示词生成美食图像
  2. 02涵盖俯拍到动态镜头的风格
  3. 03提供光线与构图指导
  4. 04支持 max 和 eco 模式
  5. 05通过会话延续菜单风格

适用场景

  1. 01制作餐厅菜单图片
  2. 02准备外卖平台缩略图
  3. 03为食谱博客配图
  4. 04制作美食社交媒体内容

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/eachlabs/skills --skill food-photography-generation

安装后在 Claude Code 中输入/food-photography-generation确认已加载。

附带文件references/SSE-EVENTS.md

详细介绍

美食摄影生成

使用 each::sense API 生成令人惊艳、引人垂涎的美食摄影作品。为餐厅菜单、外卖平台、食谱博客和社交媒体美食内容创作专业品质的图片。

概览

each::sense API 支持 AI 驱动的美食摄影生成,可用于:

  • 餐厅菜单:为纸质和电子菜单呈现高品质菜品
  • 外卖应用:制作诱人的缩略图,吸引顾客下单
  • 食谱博客:制作主图和分步视觉素材
  • 社交媒体内容:创作适合 Instagram 发布、吸引受众的美食照片

快速开始

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": "Generate a professional food photo of a gourmet burger with melted cheese, fresh lettuce, and crispy bacon on a rustic wooden board, warm lighting, shallow depth of field"}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "max"
  }'

美食摄影风格

风格描述最适合
俯拍平铺90 度俯拍视角披萨、沙拉、拼盘、食材摆盘
45 度角经典的四分之三视角装盘菜品、碗装食物、分层食物
主视觉图引人注目的平视呈现招牌菜、菜单封面
动态抓拍捕捉动作(倾倒、切割、蒸汽)生动的社交媒体内容
食材摆盘将生食材巧妙地摆放在一起食谱博客、烹饪教程

使用场景示例

餐厅菜单菜品
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": "Professional restaurant menu photo of grilled salmon fillet with lemon butter sauce, asparagus, and roasted potatoes on a white ceramic plate, elegant fine dining presentation, soft natural lighting, clean background"}],
    "model": "eachsense/beta",
    "stream": true,
    "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": "Appetizing food delivery app photo of a loaded pepperoni pizza with stretchy melted mozzarella cheese, fresh basil leaves, in a pizza box, overhead angle, bright even lighting, looks delicious and ready to order"}],
    "model": "eachsense/beta",
    "stream": true,
    "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": "Beautiful recipe blog hero image of homemade chocolate chip cookies, stack of warm cookies with melted chocolate chips visible, cookie crumbs scattered on marble surface, rustic kitchen background, cozy warm tones, food photography style"}],
    "model": "eachsense/beta",
    "stream": true,
    "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": "Professional coffee shop photo of a latte with intricate leaf latte art in a ceramic cup on a wooden saucer, steam rising gently, coffee beans scattered nearby, morning light from window, cafe atmosphere"}],
    "model": "eachsense/beta",
    "stream": true,
    "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": "Elegant dessert photography of a layered tiramisu in a glass, visible coffee-soaked ladyfinger layers and mascarpone cream, dusted with cocoa powder, silver spoon beside it, dark moody background, dramatic lighting"}],
    "model": "eachsense/beta",
    "stream": true,
    "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": "Dynamic food action shot of maple syrup being poured over a stack of fluffy pancakes with fresh blueberries, syrup caught mid-pour creating a golden stream, steam rising, breakfast table setting, warm morning light"}],
    "model": "eachsense/beta",
    "stream": true,
    "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": "Overhead flat lay food photography of Italian pasta recipe ingredients: fresh tomatoes, basil leaves, garlic cloves, olive oil in a glass bottle, parmesan wedge, dried pasta, arranged artfully on a dark slate surface, natural lighting"}],
    "model": "eachsense/beta",
    "stream": true,
    "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": "Beautiful brunch table spread photography featuring avocado toast, fresh fruit bowl, croissants, orange juice glasses, and a French press coffee, rustic wooden table with linen napkins, overhead angle, bright natural daylight, lifestyle food photography"}],
    "model": "eachsense/beta",
    "stream": true,
    "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": "Commercial fast food photography of crispy fried chicken bucket meal with golden brown pieces, seasoned fries in a red container, coleslaw cup, on a branded tray, clean studio lighting, appetizing and crave-worthy presentation"}],
    "model": "eachsense/beta",
    "stream": true,
    "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": "Clean healthy meal prep photography showing glass containers with grilled chicken breast, quinoa, roasted vegetables including broccoli and sweet potato, colorful and nutritious, organized kitchen counter, bright lighting, fitness lifestyle aesthetic"}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "max"
  }'

美食摄影最佳实践

让食物看起来诱人
  • 蒸汽和热气:为热菜加入可见的蒸汽,展现新鲜感
  • 湿润感和光泽:添加闪亮的酱汁、融化的奶酪或油亮的釉面,提升吸引力
  • 色彩对比:搭配色彩丰富的食材,增强视觉趣味
  • 质感细节:突出酥脆、绵密或松脆的质感
造型和道具
  • 点缀:新鲜香草、柑橘皮屑或可食用花朵可为画面增添点睛之笔
  • 背景:使用木材、大理石或板岩等搭配协调的表面
  • 餐具:加入刀叉、餐巾或托盘,营造场景感
  • 留白:如果用于营销,请为叠加文字预留空间
灯光指南
  • 自然光:柔和的日光可营造温暖、令人愉悦的画面
  • 侧光:突出质感并营造景深
  • 避免生硬阴影:使用柔和散射光,让曝光均匀
  • 暖色调:增强食物的诱人观感

提示词技巧

有效的美食摄影提示词应包含:

  1. 食物描述:具体菜名和主要食材
  2. 呈现风格:装盘方式、点缀和摆放
  3. 相机角度:俯拍、45 度角、平视或特写
  4. 灯光:自然光、影棚灯光、暖光、戏剧性灯光或柔和灯光
  5. 道具和表面:盘子、餐具、背景材质
  6. 氛围:温馨、优雅、质朴、现代或商业风格

示例结构:

"[Photography style] of [dish name] with [key ingredients/toppings],
[presentation details], [surface/background], [lighting description],
[mood/aesthetic]"

模式选择

模式描述最适合
max最高质量,细节渲染菜单封面、主视觉图、印刷材料
eco生成更快,质量良好社交媒体帖子、快速迭代、测试

使用多轮会话保持菜单风格一致

使用 session_id 在一系列菜单图片中保持风格一致:

# First dish in menu series
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": "Professional restaurant menu photo of beef tenderloin steak with red wine reduction, roasted garlic mashed potatoes, and grilled asparagus on a white plate, elegant fine dining style, soft lighting, dark wood table background"}],
    "model": "eachsense/beta",
    "stream": true,
    "session_id": "menu-series-001",
    "mode": "max"
  }'

# Second dish maintaining consistent style
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 create a matching menu photo of pan-seared duck breast with cherry glaze, wild rice pilaf, and sauteed spinach, same elegant fine dining style and plating"}],
    "model": "eachsense/beta",
    "stream": true,
    "session_id": "menu-series-001",
    "mode": "max"
  }'

# Third dish in the series
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": "Continue with a dessert photo in the same style: chocolate lava cake with vanilla ice cream and raspberry coulis, elegant presentation matching the previous dishes"}],
    "model": "eachsense/beta",
    "stream": true,
    "session_id": "menu-series-001",
    "mode": "max"
  }'

错误处理

错误代码描述解决方案
401API 密钥无效确认 EACHLABS_API_KEY 正确无误
400请求无效检查 JSON 格式和必需参数
429超出速率限制实现指数退避
500服务器错误使用指数退避重试

错误处理示例:

response=$(curl -s -w "\n%{http_code}" -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": "Professional food photo of a sushi platter with various nigiri and maki rolls, fresh wasabi and pickled ginger, elegant Japanese presentation on a black lacquer tray"}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "max"
  }')

http_code=$(echo "$response" | tail -n1)
body=$(echo "$response" | sed '$d')

if [ "$http_code" -eq 200 ]; then
  echo "Success: $body"
else
  echo "Error $http_code: $body"
fi

相关技能

评论

支持 Markdown