layerai/skills

layer-image-editing

Use when changing an image that already exists on Layer rather than generating a new one: editing or replacing part of it, inpainting with a mask, outpainting or extending the frame, reframing to another aspect ratio, relighting, restyling, re-rendering fro…

Vedi sorgente

Come usare

  1. Copia il comando e controlla il pacchetto prima di installarlo nel tuo ambiente agente.
  2. Controlla strumenti, credenziali e ambienti richiesti nel documento originale.
  3. Descrivi input e risultato desiderato; confronta l’output con le fonti.
npx skills add https://github.com/layerai/skills --skill layer-image-editing

Prima di iniziare

  • L’installazione non include abbonamenti, quote API o accesso ai file.
  • Stelle e installazioni indicano attività, non un test indipendente di qualità o sicurezza.
Documento Skill originale

Contenuto dal repository con titoli, esempi, codice, tabelle, link e immagini preservati.

Layer Image Editing

Overview

Editing is not generation with an image attached. Each intent maps to its own use_case, and picking the wrong one is the usual reason an edit changes things it should not have touched.

The user wantsfilter.use_caseAttach
Change one region, keep the rest exactinpaintinginit_image plus a mask
Change the whole image by instructionimage_editinginit_image
Extend past the current framereframinginit_image
Fit another aspect ratioreframinginit_image
The same subject from another anglemulti_angleinit_image or reference_image
Separate, editable layerssplit_into_layersinit_image
Cut the subject outbackground_removalinit_image
More pixels, same pictureupscalinginit_image
Clean line art into finished artimage_editinglineart or scribble
A crisp SVG from a rastervectorizationinit_image

The loop and the spend gate are in the layer skill. If a sibling skill named here is missing from your available skills, ask the user to install it (npx skills add layerai/skills --skill <name>); unattended, proceed from tool schemas and flag the gap.

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 file_id, so the original is always one argument away.

The exception is genuinely independent regions: masking the left lamp and then masking the right lamp touches disjoint pixels and stacks cleanly.

Masks

A mask marks what may change. Supply it as an uploaded file_id, or use the for_transparency and for_nontransparency 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.

Mask 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.

Point at it instead of describing it

"The lamp on the left" is ambiguous; a box on the lamp is not. On a model whose capabilities report visual_annotations, put numbered marks on the init_image (or on a reference_image, to say what to take from it) through the guidance file's annotations. Each item has an id, a kind (BOX, ELLIPSE, ARROW, FREEHAND, PIN), points from (0, 0) top left to (1, 1) bottom right, an intent (EDIT, REMOVE, or MOVE on an arrow whose source_id names the box to move) and a note saying what to do there. Two corners make a box or ellipse; an arrow is tail then head. Models of the NATIVE_BOXES kind take only boxes, and arrows moving a box, on the init_image. Leave color unset so it is chosen against the image.

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 multi_angle, a model whose capabilities report camera_transform, and the view supplied through the structured camera parameter. Attach the source with the guidance type that model accepts. yaw_degrees orbits (90 right side, 180 back, 270 left side), pitch_degrees looks down from -30 to 90 (90 is top-down), and distance_delta or fov_delta_degrees zooms. Omit a field to keep the source view: an explicit 0 is an active angle, not "unchanged".

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".

Vectors

vectorization traces a raster into SVG; trace an approved, flat-coloured, cut-out asset, since gradients and noise become thousands of shapes. The vectorize options steer the trace: vectorization_mode (spline curves or polygon straight lines), vectorization_color_mode (color, or binary black and white), vectorization_layering (stacked overlapping shapes or cutout with no overlap, colour mode only), vectorization_filter_speckle (drop specks under N pixels, 0 to 20) and vectorization_color_precision (1 to 10, lower merges more colours). For a logo or icon, lower the precision and raise the speckle filter before rerunning anything.

Layers

split_into_layers produces genuinely separate, independently editable elements, for rigging, or compositing. A side-scroller background split by depth is a different job, the parallax split in layer-environments. Before reaching for it, check what the user actually wants: "give me a PSD" usually means "give me the art with a transparent background", which is background_removal and far cheaper. Ask which one they mean when the request is ambiguous.

Worked example

"Take this approved hero portrait and make a 9:16 version for the store."

  1. The intent is reframing, not a reroll of the portrait. Generating it again loses the approval.
  2. list_base_models with filter.use_case: "reframing", take the first result.
  3. The portrait came from an earlier run, so it already has a file_id. No upload.
  4. estimate_forge_price with that file as init_image, both width and height for 9:16 (with

either missing, the output takes the source's geometry), 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.

  1. execute_forge with exactly those arguments, then poll get_forge_run at

poll_interval_seconds.

  1. Present the result beside the original so the user can confirm the subject survived.

Common mistakes

  • Stacking edits on edits instead of returning to the source image.
  • Using image_editing when only one region should change, then explaining the collateral damage.
  • Omitting what must stay constant.
  • Appending "from behind" to a prompt instead of using multi_angle with camera, or passing 0

for an axis that should stay unchanged.

  • Describing a location in words when the model takes annotations.
  • Re-rendering an approved asset through a generation model to make it bigger.
  • Reaching for split_into_layers when the user just wants a transparent background.
  • Uploading an asset Layer already produced, which already has a file_id.
dallo stesso repository

Altri Skills

Tutti gli Skills
layerai
Community

layer-3d

Use when producing 3D assets with Layer: generating a mesh from text or an image, retopologising or remeshing, retexturing an existing mesh, rigging a character, or animating a rigged mesh. Also when choosing between quad and triangle output, setting a polygon budget, or asking for PBR textures for a game engine. Keywords: 3D, mesh, model, text to 3D, image to 3D, remesh, retopology, retexture, rig, skeleton, animate, PBR, quad mesh, poly count, glTF, FBX.

Installazioni / 1h
1
GitHub Stars
10
Aggiornato
18 nov
layerai
Community

layer-audio

Use when generating audio with Layer: sound effects for a game or trailer, music and background tracks, or speech and voice-over from text. Also when a sound effect comes back with unwanted ambience or reverb, when a music prompt needs structure or length control, or when choosing a voice and delivery for narration. Keywords: SFX, sound effect, foley, UI sound, music, soundtrack, loop, text to speech, TTS, voice over, narration.

Installazioni / 1h
1
GitHub Stars
10
Aggiornato
18 nov
layerai
Community

layer-game-assets

Use when producing in-game characters and props with Layer: heroes, NPCs, enemies, bosses, mascots, creatures, items and props. Also when a cast must stay on-model across many images, when a set of sprites must share one canvas size and ground line, or when a character must be split into parts for a skeletal rig. Keywords: character art, NPC, enemy, mascot, cast, on-model, consistency, prop, item, sprite set, Spine, rigging.

Installazioni / 1h
1
GitHub Stars
10
Aggiornato
18 nov
layerai
Community

layer-game-ui

Use when making game UI with Layer: buttons, panels, frames, dialogue boxes, tabs, tooltips, HUD elements, ability and inventory icons, currency symbols, or card and badge plates. Also when a button must stretch to any width without distorting its corners, when a UI kit must import into Unity, Godot or CSS, or when an icon set must read at 64px and match approved icons. Keywords: game UI, 9-slice, nine-slice, UI kit, button, panel, frame, HUD, icon set, NinePatch, border-image.

Installazioni / 1h
1
GitHub Stars
10
Aggiornato
18 nov