layer-image-editing
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLayer Image Editing
Layer 图像编辑
Overview
概述
Editing is not generation with an image attached. Each intent maps to its own , and picking
the wrong one is the usual reason an edit changes things it should not have touched.
use_case| The user wants | | Attach |
|---|---|---|
| Change one region, keep the rest exact | | |
| Change the whole image by instruction | | |
| Extend past the current frame | | |
| Fit another aspect ratio | | |
| The same subject from another angle | | |
| Separate, editable layers | | |
| Cut the subject out | | |
| More pixels, same picture | | |
| Clean line art into finished art | | |
| A crisp SVG from a raster | | |
The loop and the spend gate are in the skill. If 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.
layernpx skills add layerai/skills --skill <name>编辑并不是附加一张图像后进行生成。每种意图都对应各自的 ,选错通常是编辑结果意外影响了本应保持不变部分的原因。
use_case| 用户希望 | | 需附加 |
|---|---|---|
| 修改一个区域,其余部分完全保持不变 | | |
| 根据指令修改整张图像 | | |
| 扩展到当前画布之外 | | |
| 调整为其他宽高比 | | |
| 展示同一主体的另一个角度 | | |
| 拆分为可单独编辑的图层 | | |
| 将主体从背景中抠出 | | |
| 增加像素数量,但保持画面不变 | | |
| 将干净的线稿处理为成品艺术图 | | |
| 从栅格图生成清晰的 SVG | | |
执行循环和费用控制逻辑位于 skill 中。如果这里提到的某个同级 skill 不在可用 skills 中,请让用户安装它();在无人值守情况下,则根据 tool schemas 继续执行,并指出缺失项。
layernpx skills add layerai/skills --skill <name>Edit from the source, not from the last edit
从源图编辑,而不是基于上一次编辑
Every edit pass is a fresh generation that re-renders the whole image, so each one drifts a little:
colours shift, a face loses its likeness, a logo degenerates. Three passes stacked on each other look
visibly worse than one pass that does all three things.
So when an edit is wrong, go back to the original and write a better instruction. Do not correct the
correction. Output assets carry a , so the original is always one argument away.
file_idThe exception is genuinely independent regions: masking the left lamp and then masking the right lamp
touches disjoint pixels and stacks cleanly.
每一次编辑都会触发一次全新生成并重新渲染整张图像,因此每次都会产生轻微漂移:颜色变化、人脸失去相似度、标志退化。将三次编辑依次叠加,视觉效果明显比一次编辑同时完成这三项操作更差。
因此,当编辑结果不正确时,应回到原始图像并编写更好的指令。不要在上一次修正的基础上继续修正。输出资产带有 ,因此只需传入一个参数即可取回原图。
file_id例外情况是真正彼此独立的区域:先 mask 左侧的灯,再 mask 右侧的灯,修改的是互不相交的像素,能够干净地叠加。
Masks
Mask
A mask marks what may change. Supply it as an uploaded , or use the and
flags when the image's own alpha channel already describes the region, which
saves authoring a mask by hand for an asset that is already cut out.
file_idfor_transparencyfor_nontransparencyMask edges matter. A hard-edged mask on a soft-edged subject leaves a halo. When the boundary is hair,
smoke, or glass, prefer an instruction edit over a mask, because the model resolves the boundary
better than your rectangle does.
Mask 用于标记允许发生变化的内容。可以将其作为已上传文件的 提供;如果图像自身的 alpha 通道已经描述了目标区域,也可以使用 和 标志,从而无需为已经抠出的资产手动制作 mask。
file_idfor_transparencyfor_nontransparencyMask 边缘很重要。在柔边主体上使用硬边缘 mask 会留下光晕。当边界是头发、烟雾或玻璃时,优先使用指令编辑而非 mask,因为模型对边界的处理比矩形 mask 更好。
What to hold constant
需要保持不变的内容
State it in the instruction. Models are literal about what you mention and careless about what you
do not, so "change the banner to red, keep the pose, lighting, and armour exactly as they are" is a
materially different instruction from "make the banner red". The clause costs six words and saves a
reroll.
应在指令中明确说明。模型会严格处理你明确提到的内容,却容易忽略你没有提到的内容,因此“将横幅改为红色,保持姿势、光线和盔甲完全不变”与“将横幅改为红色”是实质上不同的指令。这个子句只增加六个词,却能省下一次重跑。
Angles are not a prompt trick
视角不是提示词技巧
"The same character from behind" appended to a text-to-image prompt produces a different character.
Re-rendering an existing asset from another view needs , a model whose capabilities
report , and the view supplied through the structured parameter, which
orbits to side, back, or top, or zooms. Attach the source with the guidance type that model accepts.
multi_anglecamera_transformcamera在文生图 prompt 后追加“同一角色从背面看”会生成一个不同的角色。要从另一个视角重新渲染现有资产,需要使用 ,选择其能力报告中包含 的模型,并通过结构化的 参数提供目标视角;该参数可环绕至侧面、背面或顶部,也可进行缩放。应按照模型接受的 guidance type 附加源图。
multi_anglecamera_transformcameraUpscaling
Upscaling
Upscaling adds resolution without changing what the picture depicts. It must never route through a
generation model: re-rendering at a larger size is a new image that merely resembles the approved
one, and approved art has to survive the step unchanged. Use .
filter.use_case: "upscaling"Upscaling 用于增加分辨率,而不改变画面所描绘的内容。它绝不能通过生成模型处理:以更大尺寸重新渲染会生成一张仅仅与已批准版本相似的新图像,而已批准的艺术资产必须在此步骤中保持不变。使用 。
filter.use_case: "upscaling"Layers
图层
split_into_layersbackground_removalsplit_into_layersbackground_removalWorked example
实例
"Take this approved hero portrait and make a 9:16 version for the store."
- The intent is , not a reroll of the portrait. Generating it again loses the approval.
reframing - with
list_base_models, take the first result.filter.use_case: "reframing" - The portrait came from an earlier run, so it already has a . No upload.
file_id - with that file as
estimate_forge_price, the target ratio, and an instruction naming what must not change: "extend the scene above and below, keep the character, crop, and lighting untouched." Above 20 CUs, present the table and wait for an explicit yes.init_image - with exactly those arguments, then poll
execute_forgeatget_forge_run.poll_interval_seconds - Present the result beside the original so the user can confirm the subject survived.
“将这张已批准的主角肖像制作成用于商店的 9:16 版本。”
- 该意图是 ,而不是重新生成肖像。再次生成会丢失已经获得的批准。
reframing - 使用 调用
filter.use_case: "reframing",选择第一个结果。list_base_models - 这张肖像来自之前的运行,因此已经拥有 ,无需上传。
file_id - 使用该文件作为 ,并提供目标比例和一条明确说明哪些内容不得改变的指令,调用
init_image:“向上和向下扩展场景,保持角色、裁剪和光线不变。”费用超过 20 CU 时,展示价格表并等待用户明确同意。estimate_forge_price - 使用完全相同的参数调用 ,然后按照
execute_forge轮询poll_interval_seconds。get_forge_run - 将结果与原图并排展示,供用户确认主体是否保持不变。
Common mistakes
常见错误
- Stacking edits on edits instead of returning to the source image.
- Using when only one region should change, then explaining the collateral damage.
image_editing - Omitting what must stay constant.
- Appending "from behind" to a prompt instead of using with
multi_angle.camera - Re-rendering an approved asset through a generation model to make it bigger.
- Reaching for when the user just wants a transparent background.
split_into_layers - Uploading an asset Layer already produced, which already has a .
file_id
- 在编辑结果上继续叠加编辑,而不是回到源图。
- 本应只修改一个区域却使用 ,然后再解释由此产生的附带变化。
image_editing - 遗漏必须保持不变的内容。
- 在 prompt 后追加“from behind”,而不是使用带有 的
camera。multi_angle - 通过生成模型重新渲染已批准的资产来放大图像。
- 用户只是想要透明背景,却使用 。
split_into_layers - 上传 Layer 已经生成的资产,而该资产本来就带有 。
file_id