mcpField
V
vgl

vgl

github.com/bria-ai创意与媒体74222 次安装1 周前更新
代码仓库

关于 vgl

vgl 是一项技能,使用结构化 JSON 为 Bria 的 Fibo 模型编写图像生成和编辑指令,适合需要明确控制场景元素与视觉属性的用户。它提供生成、编辑、图像描述和提示词优化模式。

主要功能

  1. 01结构化视觉 JSON 提示
  2. 02生成与编辑模式
  3. 03蒙版区域编辑指令
  4. 04图像描述模式
  5. 05提示词优化
  6. 06明确控制相机与光线

适用场景

  1. 01指定可复现的图像构图
  2. 02描述对参考图的编辑
  3. 03填充选定的蒙版区域
  4. 04优化已有视觉提示词

安装

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

$npx skills add https://github.com/bria-ai/bria-skill --skill vgl

安装后在 Claude Code 中输入/vgl确认已加载。

附带文件references/schema-reference.md

详细介绍

Bria VGL — 全面掌控图像生成

将每项视觉属性定义为结构化 JSON,而不是寄希望于自然语言能准确表达。VGL(视觉生成语言)让你能够明确、确定地控制 Bria Fibo 模型中的对象、光照、相机设置、构图和风格。

相关技能:使用 bria-ai 通过 Bria API 执行这些 VGL 提示词。VGL 定义结构化控制格式;bria-ai 负责生成、编辑和移除背景。

核心概念

VGL 用确定性的 JSON 取代含糊的自然语言提示词,明确声明每项视觉属性:对象、光照、相机设置、构图和风格。这能确保图像生成结果可复现、可控。

操作模式

模式输入输出用途
生成文本提示词VGL JSON根据描述创建新图像
编辑图像 + 指令VGL JSON修改参考图像
带蒙版编辑带蒙版的图像 + 指令VGL JSON填充灰色蒙版区域
图像描述仅图像VGL JSON描述现有图像
优化现有 JSON + 编辑内容更新后的 VGL JSON修改现有提示词

JSON 架构

输出一个包含以下必需键的有效 JSON 对象:

1. short_description(字符串)

用简洁的文字概述图像内容,不超过 200 个单词。包含主要主体、动作、场景和氛围。

2. objects(数组,最多 5 项)

每个对象都必须包含:

{
  "description": "Detailed description, max 100 words",
  "location": "center | top-left | bottom-right foreground | etc.",
  "relative_size": "small | medium | large within frame",
  "shape_and_color": "Basic shape and dominant color",
  "texture": "smooth | rough | metallic | furry | fabric | etc.",
  "appearance_details": "Notable visual details",
  "relationship": "Relationship to other objects",
  "orientation": "upright | tilted 45 degrees | facing left | horizontal | etc."
}

人物主体需添加:

{
  "pose": "Body position description",
  "expression": "winking | joyful | serious | surprised | calm",
  "clothing": "Attire description",
  "action": "What the person is doing",
  "gender": "Gender description",
  "skin_tone_and_texture": "Skin appearance"
}

对象群组需添加:

{
  "number_of_objects": 3
}

尺寸建议:如果人物是主要主体,请使用 "medium-to-large" 或 "large within frame"。

3. background_setting(字符串)

描述整体环境、场景,以及未包含在 objects 中的背景元素。

4. lighting(对象)
{
  "conditions": "bright daylight | dim indoor | studio lighting | golden hour | blue hour | overcast",
  "direction": "front-lit | backlit | side-lit from left | top-down",
  "shadows": "long, soft shadows | sharp, defined shadows | minimal shadows"
}
5. aesthetics(对象)
{
  "composition": "rule of thirds | symmetrical | centered | leading lines | medium shot | close-up",
  "color_scheme": "monochromatic blue | warm complementary | high contrast | pastel",
  "mood_atmosphere": "serene | energetic | mysterious | joyful | dramatic | peaceful"
}

如果人物是主要主体,请在构图中指定镜头类型:"medium shot"、"close-up"、"portrait composition"。

6. photographic_characteristics(对象)
{
  "depth_of_field": "shallow | deep | bokeh background",
  "focus": "sharp focus on subject | soft focus | motion blur",
  "camera_angle": "eye-level | low angle | high angle | dutch angle | bird's-eye",
  "lens_focal_length": "wide-angle | 50mm standard | 85mm portrait | telephoto | macro"
}

人物摄影:优先使用 "standard lens (35mm-50mm)" 或 "portrait lens (50mm-85mm)"。除非有明确要求,否则避免使用广角。

7. style_medium(字符串)

"photograph" | "oil painting" | "watercolor" | "3D render" | "digital illustration" | "pencil sketch"

除非有明确要求,否则默认为 "photograph"。

8. artistic_style(字符串)

如果不是照片,请用不超过 3 个词描述其特点:"impressionistic, vibrant, textured"

如果是照片,请使用 "realistic" 或类似描述。

9. context(字符串)

描述图像类型/用途:

  • "High-fashion editorial photograph for magazine spread"
  • "Concept art for fantasy video game"
  • "Commercial product photography for e-commerce"
10. text_render(数组)

默认值:空数组 []

只有当用户明确提供了确切文本内容时才填写:

{
  "text": "Exact text from user (never placeholder)",
  "location": "center | top-left | bottom",
  "size": "small | medium | large",
  "color": "white | red | blue",
  "font": "serif typeface | sans-serif | handwritten | bold impact",
  "appearance_details": "Metallic finish | 3D effect | etc."
}

例外:物体本身不可或缺的通用文字(例如,停车标志上的 "STOP")。

11. edit_instruction(字符串)

用一条祈使句描述编辑/生成操作。

编辑指令格式

标准编辑(无蒙版)

以动作动词开头,描述要做的更改,绝不提及“原始图像”:

类别改写后的指令
风格更改Turn the image into the cartoon style.
对象属性Change the dog's color to black and white.
添加元素Add a wide-brimmed felt hat to the subject.
移除对象Remove the book from the subject's hands.
替换对象Change the rose to a bright yellow sunflower.
光照Change the lighting from dark and moody to bright and vibrant.
构图Change the perspective to a wider shot.
文本更改Change the text "Happy Anniversary" to "Hello".
画质Refine the image to obtain increased clarity and sharpness.
用于遮罩区域编辑

将“遮罩区域”或“遮罩区域范围”作为目标:

意图重写后的指令
生成对象Generate a white rose with a blue center in the masked region.
扩展Extend the image into the masked region to create a scene featuring...
填充背景Create the following background in the masked region: A vast ocean extending to horizon.
填充氛围Fill the background masked area with a clear, bright blue sky with wispy clouds.
修复主体Restore the area in the mask with a young woman.
填充环境Create inside the masked area: a greenhouse with rows of plants under glass ceiling.

保真规则

标准编辑模式

除非指令明确要求更改,否则保留所有视觉属性:

  • 主体身份、姿势、外观
  • 对象是否存在、位置、大小、方向
  • 构图、相机角度、镜头特性
  • 风格/媒介

只更改编辑严格要求的内容。

遮罩编辑模式
  • 完全保留所有可见(未遮罩)部分
  • 填充灰色遮罩区域,使其与未遮罩区域无缝融合
  • 匹配现有风格、光线和主体内容
  • 切勿描述灰色遮罩;应描述填充其中的内容

输出示例

{
  "short_description": "A professional businesswoman in a navy blazer stands confidently in a modern glass office, holding a tablet. Natural daylight streams through floor-to-ceiling windows, creating a warm, productive atmosphere.",
  "objects": [
    {
      "description": "A confident businesswoman in her 30s with shoulder-length dark hair, wearing a tailored navy blazer over a white blouse. She holds a tablet in her left hand while gesturing naturally with her right.",
      "location": "center-right",
      "relative_size": "large within frame",
      "shape_and_color": "Human figure, navy and white clothing",
      "texture": "smooth fabric, professional attire",
      "appearance_details": "Minimal jewelry, well-groomed professional appearance",
      "relationship": "Main subject, interacting with tablet",
      "orientation": "facing slightly left, three-quarter view",
      "pose": "Standing upright, relaxed professional stance",
      "expression": "confident, approachable smile",
      "clothing": "Tailored navy blazer, white silk blouse, dark trousers",
      "action": "Presenting or reviewing information on tablet",
      "gender": "female",
      "skin_tone_and_texture": "Medium warm skin tone, healthy smooth complexion"
    },
    {
      "description": "A modern tablet device with a bright display showing charts and graphs",
      "location": "center, held by subject",
      "relative_size": "small",
      "shape_and_color": "Rectangular, silver frame with illuminated screen",
      "texture": "smooth glass and metal",
      "appearance_details": "Thin profile, business application visible on screen",
      "relationship": "Held by businesswoman, focus of her attention",
      "orientation": "vertical, screen facing viewer at slight angle",
      "pose": null,
      "expression": null,
      "clothing": null,
      "action": null,
      "gender": null,
      "skin_tone_and_texture": null,
      "number_of_objects": null
    }
  ],
  "background_setting": "Modern corporate office interior with floor-to-ceiling windows overlooking a city skyline. Minimalist furniture in neutral tones, potted plants adding touches of green.",
  "lighting": {
    "conditions": "bright natural daylight",
    "direction": "side-lit from left through windows",
    "shadows": "soft, natural shadows"
  },
  "aesthetics": {
    "composition": "rule of thirds, medium shot",
    "color_scheme": "professional blues and neutral whites with warm accents",
    "mood_atmosphere": "confident, professional, welcoming"
  },
  "photographic_characteristics": {
    "depth_of_field": "shallow, background slightly soft",
    "focus": "sharp focus on subject's face and upper body",
    "camera_angle": "eye-level",
    "lens_focal_length": "portrait lens (85mm)"
  },
  "style_medium": "photograph",
  "artistic_style": "realistic",
  "context": "Corporate portrait photography for company website or LinkedIn professional profile.",
  "text_render": [],
  "edit_instruction": "Generate a professional businesswoman in a modern office environment holding a tablet."
}

常见误区

  1. 不要编造文字 - 除非用户提供确切文字,否则将 text_render 留空
  2. 不要过度描述 - 最多描述 5 个对象,优先描述最重要的对象
  3. 匹配模式 - 为遮罩编辑和标准编辑使用正确的 edit_instruction 格式
  4. 保持保真度 - 只更改明确要求更改的内容
  5. 具体明确 - 使用具体数值(“85mm 人像镜头”),而非模糊描述(“不错的相机”)
  6. 无关字段设为 null - 非人物对象的特定于人的字段应设为 null
curl 示例
curl -X POST "https://engine.prod.bria-api.com/v2/image/generate" \
  -H "api_token: $BRIA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "User-Agent: BriaSkills/1.4.0" \
  -d '{
    "structured_prompt": "{\"short_description\": \"...\", ...}",
    "prompt": "Generate this scene",
    "aspect_ratio": "16:9"
  }'

参考资料

  • Schema 参考 - 包含所有参数值的完整 JSON schema
  • bria-ai - 用于执行 VGL 提示词的 API 客户端和端点文档

评论

支持 Markdown