layer-image
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLayer Image Generation
Layer 图像生成
Overview
概述
The loop is the one the skill teaches: with
, , estimate, execute, poll. What separates a
usable image from a near miss is the prompt and the per-model contract, not the model choice, which
the curated ranking already handles.
layerlist_base_modelsfilter.use_case: "text_to_image"get_base_modelEditing an image that already exists is a different use case with different rules: see
. Sprites, icons, and game UI have their own constraints: see
. Holding one look across a set: see .
layer-image-editinglayer-game-assetslayer-reference-setsIf a sibling skill named here is missing from your available skills, ask the user to install it
(); unattended, proceed from tool schemas and flag the
gap.
npx skills add layerai/skills --skill <name>layerlist_base_modelsfilter.use_case: "text_to_image"get_base_model编辑已有图像属于另一种用例,需要遵循不同的规则:请参阅
。Sprites、图标和游戏 UI 有各自的约束:请参阅
。在一组图片中保持统一风格:请参阅 。
layer-image-editinglayer-game-assetslayer-reference-sets如果此处提到的同级 skill 不在可用 skill 列表中,请让用户安装
();在无人值守场景下,则根据工具 schema 继续操作,并标记该缺失项。
npx skills add layerai/skills --skill <name>What a prompt must name
提示词必须明确的内容
A model fills every gap you leave, and it fills it with the most average answer in its training data.
Each of these is a gap worth closing, in roughly this order of impact:
- Subject, concretely. "A dwarf blacksmith" beats "a fantasy character".
- Style register, as a production term rather than an artist's name: hand-painted, cel-shaded, flat vector, painterly semi-realism, stylised PBR render, gouache, 90s airbrush.
- Shot and framing: full body, three-quarter portrait, top-down, isometric, extreme close-up. This is the single most common omission and the most common cause of a reroll.
- Lighting: key direction, hardness, time of day, practical sources. "Rim-lit from behind, warm forge glow below" is a decision; "good lighting" is not.
- Palette, named or constrained: "muted teal and rust, two accent hues only".
- Background treatment: flat colour, isolated on transparent, environment implied, full scene. Assets that will be composited need this stated, not assumed.
Leave out what does not matter. A prompt that specifies everything specifies nothing, because the
model weights the whole string and dilutes the parts you cared about.
模型会填补你留下的每一个空白,而且通常会用其训练数据中最平庸的答案来填补。以下这些空白都值得补齐,其影响程度大致按此顺序排列:
- 主体,要具体。“一位矮人铁匠”胜过“一个奇幻角色”。
- 风格类别,应使用制作术语,而不是艺术家姓名:手绘、赛璐璐上色、 扁平矢量、绘画式半写实、风格化 PBR 渲染、水粉、90 年代喷绘。
- 镜头与取景:全身、四分之三视角肖像、俯视、等距视角、特写。 这是最常被省略的信息,也是导致重新生成的最常见原因。
- 光照:主光方向、硬度、时间以及实际光源。“从后方形成轮廓光, 下方带暖色熔炉辉光”是一项明确决策,而“良好的光照”不是。
- 配色,应明确命名或加以限制:“低饱和青绿色与铁锈色,仅使用两种辅助色”。
- 背景处理:纯色、隔离在透明背景上、暗示环境存在或完整场景。 后续需要合成的素材必须明确说明这些要求,不能依赖默认行为。
不要描述无关紧要的内容。如果提示词指定了一切,也就等于什么都没指定,因为
模型会权衡整个字符串,从而稀释你真正关注的部分。
Sizing, and the fields that differ
尺寸,以及各模型不同的字段
Aspect ratio and resolution are per-model contracts. Two models that both do text-to-image disagree
about whether they take an aspect ratio string, explicit width and height, or a fixed set of named
sizes, so read rather than reusing the shape that worked last time.
get_base_modelWhen the deliverable has a fixed ratio, filter for it. is an object of
booleans, not a list of names, so it is : , ,
, or when the user will want several crops from one setup.
Set only what the task needs, since filters rather than defaults.
filter.capabilities{portrait_9_16: true}squareportrait_9_16landscape_16_9multiple_aspect_ratiosfalse宽高比和分辨率由每个模型的契约决定。两个都支持 text-to-image 的模型,可能分别要求
宽高比字符串、明确的宽度和高度,或一组固定的命名尺寸,因此应读取 ,
而不是沿用上次奏效的参数结构。
get_base_model当交付物需要固定比例时,应按该比例筛选。 是一个布尔值对象,
而不是名称列表,因此应写成 :可使用 、、
,或在使用者需要从同一设置中生成多种裁切比例时使用 。
只设置任务真正需要的字段,因为 表示过滤,而不是设置默认值。
filter.capabilities{portrait_9_16: true}squareportrait_9_16landscape_16_9multiple_aspect_ratiosfalseNegatives, references, and seeds
负面提示、参考与种子
negative_promptThree reference types steer a text-to-image run, all passed through after an upload:
guidance_files- with the
reference_imagecapability, for "reproduce this subject" and for new art that has to match a reference.image_editingis the older style-only transfer: it moves a look across, it does not carry a subject, so reaching for it to hold a character is the usual reason a cast drifts.style_reference - with
pose, for "put the character in this position".character_pose - ,
depth,canny, orlineartwithscribbleorstructure, for "keep this layout".outline
A reference is worth more than three adjectives. When a user has an image and is describing it in
words, upload the image.
Seeds make a run repeatable, which matters when iterating: hold the seed and change one clause to see
what that clause actually does. They do not make two different prompts consistent with each other.
For a look held across a set, train it: see .
layer-reference-setsnegative_prompt有三种参考类型可以引导 text-to-image 任务,上传后均通过 传入:
guidance_files- 配合
reference_image能力,用于“复现这个主体”,以及生成必须与某张参考图匹配的新 艺术内容。image_editing是较早期的纯风格迁移方式:它可以迁移视觉风格, 但不会携带主体,因此试图用它来保持角色一致,正是角色群像经常发生风格漂移的原因。style_reference - 配合
pose,用于“将角色置于这个姿势”。character_pose - 、
depth、canny或lineart配合scribble或structure,用于“保留这个布局”。outline
一张参考图胜过三个形容词。当用户手中已有图像并试图用文字描述它时,应直接上传该图像。
种子可以让生成结果具备可重复性,这在迭代时很重要:保持种子不变,每次只修改一个子句,
以观察该子句实际产生的影响。种子无法让两个不同的提示词彼此保持一致。
如果需要在一组图片中保持统一风格,应训练该风格:请参阅 。
layer-reference-setsText in the image
图像中的文字
Most image models garble text. When the deliverable needs readable words, filter for a model whose
description claims typography, keep the string short, and put it in quotes in the prompt. If it still
fails after two attempts, stop rerolling: generate the art clean and composite the text, which is
also what makes it editable and localisable later.
大多数图像模型无法准确生成文字。当交付物需要包含可读的词语时,应筛选描述中明确支持
typography 的模型,保持文本字符串简短,并在提示词中用引号将其标出。如果尝试两次后仍然失败,
不要继续重新生成:先生成不含文字的干净画面,再合成文字;这样也能让文字在之后保持可编辑和可本地化。
Worked example
实际示例
"Key art for our roguelike, 16:9, for the Steam page."
- with
list_base_modelsandfilter.use_case: "text_to_image". Take the first result.filter.capabilities: {landscape_16_9: true} - , which reports the sizing fields it accepts and whether it needs a trigger word.
get_base_model - Compose against the six points above: "Hooded rogue mid-leap over a collapsing stone bridge, seen three-quarter from below, hand-painted semi-realism, hard moonlight from the upper left with cold blue rim light, warm torchlight pooling below, muted slate and amber, storm-lit ruins receding into fog behind."
- with
estimate_forge_price, to see four compositions of one idea.batch_size: 4 - Under 20 CUs, so execute, then poll at .
poll_interval_seconds - Present all four. Pick one, hold its seed, and iterate one clause at a time.
“用于我们 Roguelike 的主视觉,16:9,用于 Steam 页面。”
- 使用 ,设置
list_base_models和filter.use_case: "text_to_image"。选择第一个结果。filter.capabilities: {landscape_16_9: true} - 使用 ,查看它接受的尺寸字段,以及是否需要触发词。
get_base_model - 根据上述六点编写提示词:“披着兜帽的盗贼跃过正在坍塌的石桥,从下方以四分之三视角观察, 手绘半写实风格,左上方硬质月光配冷蓝色轮廓光,下方暖色火光汇聚,低饱和石板灰与琥珀色, 背后被风暴照亮的废墟渐隐入雾中。”
- 使用 并设置
estimate_forge_price,查看同一构想的四种方案。batch_size: 4 - 如果低于 20 CUs,则执行生成,然后按照 进行轮询。
poll_interval_seconds - 展示全部四张结果。选择其中一张,保持其种子不变,每次只迭代修改一个子句。
Common mistakes
常见错误
- Omitting shot and framing, then rerolling the same prompt hoping for a different crop.
- Describing a reference image in words instead of uploading it.
- Sending to a model that does not declare the capability.
negative_prompt - Reusing the sizing fields from a different model rather than reading .
get_base_model - Using for N different assets. It makes variations of one prompt.
batch_size - Chasing readable text through a sixth reroll instead of compositing it.
- Stacking five style adjectives, which averages them into none of them.
- 省略镜头与取景,然后反复使用同一提示词,希望得到不同的裁切结果。
- 用文字描述参考图,而不是直接上传参考图。
- 向未声明支持 能力的模型传入该参数。
negative_prompt - 沿用其他模型的尺寸字段,而不是读取 。
get_base_model - 使用 一次生成 N 个不同素材;它只会生成同一提示词的变体。
batch_size - 为了追求可读文字而进行第六次重新生成,而不是将文字合成到图像中。
- 堆叠五个风格形容词,结果将它们平均化,最终失去所有风格特征。