rig-parts 1.82.0 → 1.82.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.ts +26 -17
- package/docs/AUTHORING.md +32 -4
- package/docs/STABILITY.md +1 -1
- package/package.json +1 -1
- package/src/assemble.ts +60 -17
package/cli.ts
CHANGED
|
@@ -794,9 +794,9 @@ usage:
|
|
|
794
794
|
outside the painting, by name.
|
|
795
795
|
|
|
796
796
|
rig-parts comfy seethrough --image <png> --out <dir> [--host <url>]
|
|
797
|
-
[--resolution 1024] [--steps 30] [--seed 42] [--offload] [--lama] [--nf4]
|
|
797
|
+
[--resolution 1024] [--steps 30] [--seed 42] [--offload | --no-offload] [--lama] [--nf4]
|
|
798
798
|
[--prefix spine_parts] [--wait 1800] [--timeout 3600] [--poll 3]
|
|
799
|
-
[--config <config.json> --depth-run <full|head>]
|
|
799
|
+
[--config <config.json>] [--depth-run <full|head>]
|
|
800
800
|
Optional. Run See-through on a ComfyUI box with the jtydhr88/ComfyUI-See-through
|
|
801
801
|
wrapper installed, and write the wrapper form \`layers\` reads into <out>
|
|
802
802
|
(absent or empty): layers.json, parts/<tag>.png, meta.json, previews/.
|
|
@@ -805,9 +805,14 @@ usage:
|
|
|
805
805
|
queue (at most --wait s), polls /history (at most --timeout s), and
|
|
806
806
|
writes <out> only after the layer reader accepts what came back.
|
|
807
807
|
--lama turns the wrapper's LaMa inpainting on and --nf4 its nf4
|
|
808
|
-
quantisation; both are off unless given,
|
|
809
|
-
|
|
810
|
-
|
|
808
|
+
quantisation; both are off unless given. Resolution, steps, seed and offload
|
|
809
|
+
use explicit flags first, then --config's seethrough block, then defaults
|
|
810
|
+
1024, 30, 42 and false. The resolved resolution must be an integer of at
|
|
811
|
+
least 64, including config values. --no-offload overrides a config's true; it cannot
|
|
812
|
+
be combined with --offload. Each value prints its source. No config is
|
|
813
|
+
discovered automatically: give --config <config.json> to use its settings.
|
|
814
|
+
Depth hints are inactive by default. --config also reads its optional
|
|
815
|
+
depth block; with that block --depth-run explicitly selects full or head.
|
|
811
816
|
Active declared sheets are fetched and validated, never inferred.
|
|
812
817
|
|
|
813
818
|
rig-parts comfy paint --config <config.json> --out <dir> [--host <url>]
|
|
@@ -1077,7 +1082,7 @@ const TAKES = {
|
|
|
1077
1082
|
check: { valued: ['--rig', '--out', '--parts', '--source', '--page-edges', '--pack-shape', '--requirements', '--set', '--environment', '--wind-band'], switches: ['--seam-pairs', '--keep-stills', '--all-sets', '--no-extremes'] },
|
|
1078
1083
|
loop: { valued: ['--frames', '--out'], switches: ['--palette'] },
|
|
1079
1084
|
assemble: { valued: ['--source', '--full', '--head', '--config', '--out', '--seam', '--project', '--alt', '--write-config'], switches: ['--propose-plan'] },
|
|
1080
|
-
'comfy seethrough': { valued: ['--image', '--out', '--resolution', '--steps', '--seed', '--prefix', '--host', '--wait', '--timeout', '--poll', '--config', '--depth-run'], switches: ['--offload', '--lama', '--nf4'] },
|
|
1085
|
+
'comfy seethrough': { valued: ['--image', '--out', '--resolution', '--steps', '--seed', '--prefix', '--host', '--wait', '--timeout', '--poll', '--config', '--depth-run'], switches: ['--offload', '--no-offload', '--lama', '--nf4'] },
|
|
1081
1086
|
'comfy paint': { valued: ['--config', '--out', '--seeds', '--seed0', '--host', '--wait', '--timeout', '--poll'], switches: [] },
|
|
1082
1087
|
inputs: { valued: ['--source', '--config', '--out'], switches: [] },
|
|
1083
1088
|
build: { valued: ['--config', '--source', '--full', '--head', '--out', '--seam', '--project', '--page-edges', '--pack-shape', '--requirements', '--idle-keys', '--lead-in', '--alt', '--set', '--environment', '--wind-band'], switches: ['--loop', '--seam-pairs', '--keep-stills', '--all-sets', '--no-extremes'] },
|
|
@@ -1768,12 +1773,11 @@ function comfyFlags(args: string[], command: 'comfy seethrough' | 'comfy paint')
|
|
|
1768
1773
|
return { v, on };
|
|
1769
1774
|
}
|
|
1770
1775
|
|
|
1771
|
-
/**
|
|
1772
|
-
function intFlag(v: Map<string, string>, flag: string, fallback: number, min: number): number | string {
|
|
1776
|
+
/** The resolved flag or fallback must be an integer at or above `min`; a string is a usage error. */
|
|
1777
|
+
function intFlag(v: Map<string, string>, flag: string, fallback: number, min: number, fallbackSource = flag): number | string {
|
|
1773
1778
|
const raw = v.get(flag);
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
return Number.isInteger(n) && n >= min ? n : `${flag} ${raw} is not an integer of at least ${min}`;
|
|
1779
|
+
const n = raw === undefined ? fallback : Number(raw);
|
|
1780
|
+
return Number.isInteger(n) && n >= min ? n : `${raw === undefined ? fallbackSource : flag} ${raw ?? fallback} is not an integer of at least ${min}`;
|
|
1777
1781
|
}
|
|
1778
1782
|
|
|
1779
1783
|
/** A seconds flag above 0, or its stated default. */
|
|
@@ -1790,6 +1794,7 @@ async function cmdComfy(args: string[]): Promise<number> {
|
|
|
1790
1794
|
const f = comfyFlags(rest, `comfy ${sub}`);
|
|
1791
1795
|
if (typeof f === 'string') return usage(f);
|
|
1792
1796
|
const { v, on } = f;
|
|
1797
|
+
if (on.has('--offload') && on.has('--no-offload')) return usage('--offload and --no-offload cannot be combined');
|
|
1793
1798
|
const wait = secondsFlag(v, '--wait', 1800);
|
|
1794
1799
|
const timeout = secondsFlag(v, '--timeout', 3600);
|
|
1795
1800
|
const poll = secondsFlag(v, '--poll', 3);
|
|
@@ -1803,7 +1808,8 @@ async function cmdComfy(args: string[]): Promise<number> {
|
|
|
1803
1808
|
// config comfy paint cannot paint from is refused with no box named.
|
|
1804
1809
|
const paint = sub === 'paint' ? loadPaintConfig(configPath as string) : null;
|
|
1805
1810
|
const cfg = paint === null ? null : paint.config;
|
|
1806
|
-
const
|
|
1811
|
+
const early = sub === 'seethrough' && configPath !== undefined ? loadEarlyConfig(configPath, 'layers') : undefined;
|
|
1812
|
+
const depthConfig = early?.depth;
|
|
1807
1813
|
const depthRun = v.get('--depth-run');
|
|
1808
1814
|
if (sub === 'seethrough' && depthConfig !== undefined && depthRun !== 'full' && depthRun !== 'head') return usage('active config.depth requires --depth-run <full|head>; the source run is not inferred');
|
|
1809
1815
|
if (sub === 'seethrough' && depthConfig === undefined && depthRun !== undefined) return usage('--depth-run requires --config with an explicit depth block');
|
|
@@ -1812,9 +1818,9 @@ async function cmdComfy(args: string[]): Promise<number> {
|
|
|
1812
1818
|
if (sub === 'seethrough') {
|
|
1813
1819
|
const image = v.get('--image');
|
|
1814
1820
|
if (image === undefined) return usage('comfy seethrough needs --image <png>');
|
|
1815
|
-
const resolution = intFlag(v, '--resolution', 1024, 64);
|
|
1816
|
-
const steps = intFlag(v, '--steps', 30, 1);
|
|
1817
|
-
const seed = intFlag(v, '--seed', 42, 0);
|
|
1821
|
+
const resolution = intFlag(v, '--resolution', early?.seethrough.resolution ?? 1024, 64, 'config.seethrough.resolution');
|
|
1822
|
+
const steps = intFlag(v, '--steps', early?.seethrough.steps ?? 30, 1);
|
|
1823
|
+
const seed = intFlag(v, '--seed', early?.seethrough.seed ?? 42, 0);
|
|
1818
1824
|
for (const x of [resolution, steps, seed]) if (typeof x === 'string') return usage(x);
|
|
1819
1825
|
const prefix = v.get('--prefix') ?? 'spine_parts';
|
|
1820
1826
|
if (!/^[A-Za-z0-9_-]+$/.test(prefix)) return usage(`--prefix ${prefix} is not letters, digits, "_" and "-"`);
|
|
@@ -1825,7 +1831,7 @@ async function cmdComfy(args: string[]): Promise<number> {
|
|
|
1825
1831
|
resolution: resolution as number,
|
|
1826
1832
|
steps: steps as number,
|
|
1827
1833
|
seed: seed as number,
|
|
1828
|
-
offload: on.has('--offload'),
|
|
1834
|
+
offload: on.has('--offload') ? true : on.has('--no-offload') ? false : (early?.seethrough.offload ?? false),
|
|
1829
1835
|
lama: on.has('--lama'),
|
|
1830
1836
|
quant: on.has('--nf4') ? ('nf4' as const) : ('none' as const),
|
|
1831
1837
|
wait: wait as number,
|
|
@@ -1833,7 +1839,10 @@ async function cmdComfy(args: string[]): Promise<number> {
|
|
|
1833
1839
|
...(depthConfig === undefined ? {} : { depth: { config: depthConfig, run: depthRun as 'full' | 'head', base: dirname(resolve(configPath as string)) } }),
|
|
1834
1840
|
};
|
|
1835
1841
|
console.log(`rig-parts comfy seethrough: ${image} -> ${out}`);
|
|
1836
|
-
|
|
1842
|
+
const source = (key: 'resolution' | 'steps' | 'seed' | 'offload'): string =>
|
|
1843
|
+
v.has(`--${key}`) || (key === 'offload' && (on.has('--offload') || on.has('--no-offload'))) ? 'cli' : early === undefined ? 'default' : `config.seethrough.${key}`;
|
|
1844
|
+
console.log(` resolution ${run.resolution} (source=${source('resolution')}), steps ${run.steps} (source=${source('steps')}), seed ${run.seed} (source=${source('seed')}), offload ${run.offload} (source=${source('offload')}); lama ${run.lama}, quant ${run.quant}; wait <= ${run.wait} s, timeout ${run.timeout} s`);
|
|
1845
|
+
if (early === undefined) console.log(' no config loaded; give --config <config.json> to use config.seethrough settings; explicit CLI flags override them');
|
|
1837
1846
|
const r = await runSeeThrough(client, run, (l) => console.log(l));
|
|
1838
1847
|
console.log(` ${r.layers.length} layer(s) on a ${r.canvas[0]}x${r.canvas[1]} canvas, read back green by the layer reader: ${r.layers.join(', ')}`);
|
|
1839
1848
|
console.log(` wrote ${join(out, 'layers.json')}, meta.json, parts/ (${r.layers.length} PNG) and previews/ (${r.previews.length} PNG); GPU job ended`);
|
package/docs/AUTHORING.md
CHANGED
|
@@ -121,7 +121,7 @@ read by no CPU stage).
|
|
|
121
121
|
| `generation.*` | the optional `comfy` adapter only; no CPU stage | recorded: checkpoint, LoRAs, sampler, prompt parts, `latent`, `seed`, `control` |
|
|
122
122
|
| `generation.control.skeleton` | `comfy paint` — the OpenPose control image, drawn at `latent` | **authored**: a built-in standing pose, `"stand_sides"` or `"stand_clasp"`, or (issue #198) any other string, read as a path relative to the config file's directory to a pose file `{"width": W, "height": H, "points": {"nose": [x, y], "neck": [x, y], …}}` — `width` x `height` is the canvas and must be `generation.latent` (the points are not scaled; `CONFIG_POSE_CANVAS`), and `points` holds the 18 body-18 keypoints of `src/skeleton.ts` by name (`nose`, `neck`, `r_shoulder`, `r_elbow`, `r_wrist`, `l_shoulder`, `l_elbow`, `l_wrist`, `r_hip`, `r_knee`, `r_ankle`, `l_hip`, `l_knee`, `l_ankle`, `r_eye`, `l_eye`, `r_ear`, `l_ear`; `r`/`l` the subject's sides), each `[x, y]` in canvas px, x right, y down, `0 <= x <= W`, `0 <= y <= H`. The image is drawn from the file exactly as from a built-in (same renderer, same size), written as `control_pose-<first 12 hex of its sha256>.png`. A pose file carries no words, so `generation.pose` is required beside it (`CONFIG_FIELD_PRESENT`). The file is read wherever the config is read from a path, every problem at once: no such file — a misspelt built-in lands here too — or one that cannot be read (`CONFIG_FILE_PRESENT`), not JSON (`CONFIG_IS_JSON`), not an object, a size that is not a whole positive px count, a point that is not two numbers (`CONFIG_FIELD_TYPE`), a key besides the three (`CONFIG_KEY_KNOWN`) or written twice (`CONFIG_KEY_UNIQUE`), `points` holding other than the 18 names (`CONFIG_POSE_KEYPOINTS`, with the count found and required), a point off the canvas (`CONFIG_POSE_IN_CANVAS`, naming the point and the canvas size) |
|
|
123
123
|
| `seethrough.resolution` | assemble — each run's canvas must be `resolution` square (`ASSEMBLE_RUN_CANVAS`); with one run (no `--head`, issue #366) the file may be smaller on either side, and is padded to the `resolution` square, centred | recorded from the See-through runs; 1024 in both examples. With one run it is the square the file is read on: at least the file's longer side (`ASSEMBLE_RUN_CANVAS` otherwise), and nothing a part records depends on how much larger |
|
|
124
|
-
| `seethrough.steps`, `.seed`, `.offload` |
|
|
124
|
+
| `seethrough.steps`, `.seed`, `.offload` | `comfy seethrough --config` | run inputs when `--config <config.json>` is given; explicit CLI flags override them, including `--no-offload` for false |
|
|
125
125
|
| `seethrough.head_box` | inputs (cuts the head image there; optional at the first call); assemble — where the head run sits on the painting | **proposed** by `propose --head-box` from the full run, square, source pixels, shifted inside the painting when needed; the head run must then be fed exactly that crop. With one run (no `--head`, issue #359: an artist's own file, §4 *For artists*) it is left out — there is no crop to place — and a config that sets it is refused (`ASSEMBLE_SINGLE_RUN_HEAD_BOX`) |
|
|
126
126
|
| `seethrough.arm_split` | assemble, `assemble --propose-plan` — separates a single full-run `handwear-r` or `handwear-l` layer that holds both overlapping arms into both arm tags | **authored**, optional (issue #439): `{x?: number, line?: [[x, y], …], order: ["handwear-r", "handwear-l"] \| ["handwear-l", "handwear-r"]}` in `seethrough.resolution` full-run pixels. Exactly one of `x` (image column, `0 <= x <= resolution`) or `line` (a polyline of two or more `[x, y]` points in `[0, resolution]`, interpolated in x along y and clamped above/below its endpoints) is required (`CONFIG_FIELD_PRESENT`, `CONFIG_FIELD_TYPE`), and `order` is `[back_tag, front_tag]`, the draw order of the two separated arm layers (`CONFIG_FIELD_PRESENT`, `CONFIG_FIELD_TYPE`). Pixels at `< splitX(y)` go to `handwear-r` (image left, the subject's right arm) and pixels at `>= splitX(y)` go to `handwear-l` (image right, the subject's left arm). A split line that cuts a horizontal opaque run of the arm layer into more than two segments is refused (`ASSEMBLE_ARM_SPLIT_CUTS_ARM`). Without the declaration, when one arm layer's 8-connected component reaches both wrists under `propose --keypoints`, `propose` emits an `overlapping-arms` `LINT` naming the part, both wrists and `seethrough.arm_split`; absent, no byte of any output moves |
|
|
127
127
|
| `assemble.rig_scale` | assemble — the rig is `trunc(w × rig_scale)` x `trunc(h × rig_scale)`, and every rig-px value after it (`bones`, `meshes`, `motion`, `patches`, `cuts`) is in that rig's pixels; `check --source` (`CHECK_SOURCE_SIZE`) and `compose` (`SCENE_RIG_SCALE_AGREES`) read it back off `parts.json` | authored; rig pixels per source pixel. 0.5 in both examples (a 1664x2432 painting makes an 832x1216 rig). **Keep the figure about 1,100 to 1,200 rig px tall** — the `H` of `propose`'s `mesh spacing:` note, the height of the parts' boxes together — so for another painting, about 1,150 over the figure's height in painting px: that is the size the proposer's spacing divisor was calibrated at (H 1106–1185, the `mesh spacing` note says so) and the size of the two examples `check`'s bars are derived from, and the proposer and `check` also hold fixed rig-px values that do not scale with it (the fringe's 10 px step, the trunk segments' 18, 20, 30 and 100 px, the 15 px wrist tolerance, the 10-row pendant floor, the seam bar's 50 rig px over 40). What else it trades, measured on `demo` with the README loop from a fresh config at 0.25, 0.5 and 1 (issue #345, rig-c 2.47.1): the same plan and the same ten chains; every bar but the one the uncorrected `demo` always fails (`bottomwear` `TIP_OVER_ROOT`, the README loop's `RL01`) passing at all three; the atlas page 418x606, 832x1205 and 1825x2047; the figure's mesh spacing 16, 32 and 64, so 830, 868 and 932 triangles; the breath 2.5 % of a torso that scales with it; and the proposed bones, scaled to 0.5, off the 0.5 proposal's by up to 38 px at 0.25 and 22.5 px at 1 (the hairpin's origin; the skirt roots 20 and 10.5) — the fixed-px values above. `propose` records it on the proposal as `proposed_rig_scale` (issue #354), and changing `assemble.rig_scale` after the rig sections are written is refused (`CONFIG_PROPOSED_RIG_SCALE`): without that refusal `demo`'s tracked config built at 0.25 gated green and `check` failed only `TIP_OVER_ROOT` on both sleeves (`propose --from-config` named 54 `LINT` lines, links off the art) — re-run `assemble` and `propose` at the new scale. Absent: `CONFIG_FIELD_PRESENT`; 0, negative or not a number: `CONFIG_FIELD_TYPE`; a rig under 1x1: `ASSEMBLE_RIG_SIZE` |
|
|
@@ -131,7 +131,7 @@ read by no CPU stage).
|
|
|
131
131
|
| `assemble.patches` | assemble; `meshes`/`regions` keys may name them too | **authored**, optional: `[{name, box, alpha, draw}]` — an extra part cut from the **painting** itself, for figure no See-through layer holds (a hem both runs dropped). `box` is `[x0, y0, x1, y1]` in **rig** pixels, `x1`/`y1` exclusive — the space of `parts.json` and `recomposite_rig.png`, where the hole is found; `alpha` is `"silhouette"` (the painting's figure silhouette inside the box, the one `--seam silhouette` uses) or `"box"` (the whole box); `draw` is `"back"`, `"front"` or `{"before": "<plan part>"}`. A patch is always a region: its bone is `regions.<name>`, in the one place every region's bone lives, and a `meshes` entry for it is refused. `draw` sets assembled part order; an exclusively bound limb rider's final rig slot joins that limb's block (see the limbs subsection). Use [Source before scissors](#source-before-scissors) before a patch; §5 describes structural placement |
|
|
132
132
|
| `assemble.cuts` | assemble; `meshes`/`regions` keys may name the new parts too, and must (each is a part like any other) | **authored**, optional (issue #170): `[{from, into, polygon, draw, overlap, under, under_fill}]`, `under` and `under_fill` optional — a structural separation under [Source before scissors](#source-before-scissors), cut from a plan part's layer by the author's polygon: the pixels of plan part `from` whose **centre** lies inside `polygon` (even-odd; a centre exactly on an edge is outside) leave `from` and make the new part `into`, colour and alpha, so every pixel of the layer ends in exactly one of the two. `polygon` is `[[x, y], …]`, at least three points, non-negative integer **rig** pixels — the space of `parts.json` and of the patches' boxes. The file that shows the layer in those coordinates is `assemble`'s own `rig/parts/<from>.png`, placed at its `parts.json` `x`, `y` (the PNG's pixel `(i, j)` is rig pixel `(x + i, y + j)`), or `render/recomposite_rig.png`, the whole rig 1:1; the contact sheets (`sheet`) are scaled and carry no coordinates. `draw` is `"back"`, `"front"` or `{"before": "<plan part>"}`, as for a patch (to keep the setup pose, draw the piece immediately in front of `from` — `{"before": "<the plan part after from>"}`, or `"front"` when `from` is the last plan part; `{"before": "<from>"}` draws it behind `from`, which `under` refuses as `ASSEMBLE_UNDER_DRAW` because the fill would hide it). `from` must be a plan part (`CONFIG_NAME_RESOLVES`; a patch or another cut's piece is refused; a part a limb takes may be cut where no segment of the limb holds it, issue #564, §5 *Limbs*), `into` a new name (`CONFIG_PART_UNIQUE`), the polygon three or more integer points (`CONFIG_FIELD_TYPE`). The piece's `parts.json` record carries `from`'s `<run>:<tag>` and its own counts, each split from the layer's by where the pixel lies; it is a mesh or a region under its own name, and the coverage rule holds it like a plan part. What the config cannot know the stage refuses: a polygon point past the rig (`ASSEMBLE_CUT_INSIDE`), two cuts of one part sharing a pixel (`ASSEMBLE_CUT_OVERLAP`), a cut that takes none of the layer's opaque pixels or leaves `from` none (`ASSEMBLE_CUT_PIXELS`), a cut of a part a limb takes that takes a pixel a segment of the limb holds (`ASSEMBLE_CUT_CROSSES_LIMB`). `overlap` is required, a non-negative integer of rig pixels with no default (`CONFIG_FIELD_TYPE`): the **band** — the polygon's pixels within `overlap` px of its edge by Chebyshev distance (the polygon's mask less its erosion by a `2 * overlap + 1` square) — stays in `from` as well as going to the piece, so the piece's resampled edge has art under it; the counts stay a strict partition and the band is the base's extra copy, printed on the `cut:` line. At `0` the two abut and `check`'s seam bar judges the edge between them (`CHECK_SEAM_WITHIN_BAR`, §5). A band only covers the edge at rest: a piece that swings well clear of where it was painted shows the hole it leaves, and a thin piece's band shows a ghost of the piece. `under` (issue #193), optional, is the author's image of what lies under the piece: a PNG path relative to the config's directory (`CONFIG_FIELD_TYPE` unless a non-empty string), in rig pixels over the polygon's **bounding box** — the least and greatest polygon x and y, so the image is `max x − min x` by `max y − min y` and its pixel `(i, j)` is rig pixel `(min x + i, min y + j)`. Where the cut removed pixels from `from` — the piece's pixels (alpha above 0) less the band — `from` takes the image's pixel, colour and alpha wherever the image's alpha is at least the alpha the cut removed there (**filled**); elsewhere `from` stays empty there (**left empty**): a transparent pixel is the author's statement that nothing lies under it (the background, or a part drawn behind), and a less opaque one is not half-filled. The image is read nowhere else, so its pixels over the band, over the box outside the polygon or where the layer had no art never change `from`. The `cut:` line then ends `; under <n> px filled, <m> px left empty` (`n + m` is every removed pixel), so an unintended hole is a number in the log, not a guess; the filled pixels count in `from`'s `opaque_px` and `occluded_px` (the piece is drawn over them), never as visible or projected. The stage refuses: a file that is not there (`ASSEMBLE_UNDER_PRESENT`) or not a PNG (`ASSEMBLE_UNDER_DECODES`), an image not exactly the box's size (`ASSEMBLE_UNDER_SIZE`, both sizes given), an image that fills none of the removed pixels — all transparent there, or another file (`ASSEMBLE_UNDER_EMPTY`; to leave the whole hole, drop `under`), and a piece drawn behind `from` (`ASSEMBLE_UNDER_DRAW`: the fill would hide it; draw it `"front"` or `{"before": "<the plan part after from>"}`). Producing the image is the author's, by whatever means; absent, `from` keeps only its band. `under_fill` (issue #360), optional, is the one value `"colour"` (`CONFIG_FIELD_TYPE` on any other): the same pixels are filled and left empty, and a filled pixel takes the image's **colour** at the alpha the cut removed there instead of the image's alpha, so `from`'s alpha is the uncut layer's wherever the image fills and its silhouette does not grow — an opaque image over a soft edge leaves the edge soft. It applies to the part's hidden-art layer as well as to a file; a cut with neither is refused (`ASSEMBLE_UNDER_FILL_SOURCE`). The `cut:` line's filled count then says how many took the colour only: `; under 190 px filled (190 colour only, at the alpha the cut removed), 0 px left empty`. Absent, a filled pixel takes the image's colour and alpha, as above |
|
|
133
133
|
| `assemble.alternates` | assemble, rig, check (`--set`, `--all-sets`) | **authored**, optional (issues #454, #465, #472, #473, #476): `[{name, source?, full?, head?, head_box?, parts?, hides?, cuts?, skeleton?, anchor?, base_anchor?, drawn?, tips?, front?}]` — alternate painting sets assembled into `<out>/rig/parts/<set>_<part>.png` (`parts.json` `alternates`), attached on each covered slot in `rig.json` as `<set>_<part>` beside the base attachment, and indexed in `<out>/rig/sets.json` (`rig-parts-sets/1`: `sets.<set>.slots`, `.hides`, `.drawn` when present, and `.threshold: {yaw: 15, pitch: 12}` when the set replaces `face` on a rig with `turn` or `turn`/`tilt` slider animations). `source`, `full` and `head` may instead be given on the CLI with `--alt <name>=<source>:<full>[:<head>]`. Windows absolute drive paths such as `C:\paint\painting.png` are accepted as written; each segment's leading drive colon belongs to that path, while other colons still separate `source`, `full` and `head`. `parts` lists the subset of parts the set replaces (default: every part not in `hides`); a **subset set** (issue #473, e.g. mouth visemes `a`, `i`, `u` with `"parts": ["mouth"]`) cuts only its covered parts from the alternate runs (refusing with `ASSEMBLE_ALT_INPUT_PRESENT` if a covered part's layer is missing or empty), writes only `{slot: "<set>_<slot>"}` in `sets.json` so `@rig-c/play`'s `setSet(name)` switches those slots while leaving every other slot on its base attachment (and `setSet(null)` restores the base pose), may be keyed on a slot attachment track in `motion.animations_from` as `{"t": …, "set": "<name>" \| null}` (`CONFIG_SET_COVERS_SLOT` if `"set"` is undeclared or does not cover the track's slot), and under `check --set <name>` counts `ANIMATIONS_DO_NOT_FOLD` only on its own covered slots; `hides` lists slots the set hides (`null` in `sets.json`). A **gesture subset set** (issue #476) covers a limb chain declared in `config.limbs.<limb>` (all of its segment `part`s; with `drawn` alone, cut at the base's joints posed to the set's own `drawn` angles by `poseBoneEntriesForDrawn`, each segment keeping the base's length; with `skeleton` (issue #539), cut at the skeleton's own joint positions by `placeBoneEntriesForSkeleton` — each covered bone the body-18 table names (`sleeve_*`, `arm_*0`/`arm_*1`, `leg_*0`/`leg_*1`) at its skeleton origin with the skeleton segment's own length and direction (`drawn` overriding the direction of a bone it names), and a covered bone the table does not name (a hand link `arm_r2`, a single `foot_r`) placed from its parent's new place — its base offset from the parent, stretched along the parent by the parent's length change and turned by its turn, so a link or a foot at the parent's end lands on the skeleton's end — with its base length and the drawn or base direction, so a foreshortened shin or forearm is cut where it is painted; naming the unsplit `from` layer, covering only some segments of the limb, or declaring polygon `cuts` on a limb set is refused with `CONFIG_LIMB_SET_JOINTS`) and carries `drawn` (or `skeleton`) for the covered bones only (giving `drawn` for an uncovered bone is refused with `CONFIG_SET_COVERS_BONE` / `RIG_SET_COVERS_BONE`; uncovered bones keep the base's `drawn`). A subset set's limb part takes no pixel that a base part drawn after it, which the set neither covers nor hides, covers at setup (issue #587): the set's attachment is drawn in the base slot's place, so that base part is drawn over it and what the set's painting shows there is that base part (shorts over a leg set's thigh top, which See-through synthesised in the set's leg layer); `assemble` clears those pixels — the base part's PNG at alpha above 8, at its `parts.json` x, y, on the shared canvas — from the set's part once its limbs are cut, before any count — its `merged_px` and its cap's record too (issue #603): a cap pixel it clears leaves the count it was in (`layer_px`, `image_px`, `upper_px`, `lower_px`, `lower_kept_px`) for the cap's `excluded_px`, written only when above 0, so every count is the written PNG's — and prints `LINT set "<set>" <part>: <n> px under <base part> excluded` per part and base part that took a pixel (n counts alpha above 8); a set that carries that base part itself (`"parts": ["thigh_l", "shin_l", "bottomwear"]`) excludes nothing and writes what it wrote before. A subset set that names one limb side of a layer more limbs take (issue #588: `"parts": ["thigh_r", "shin_r"]` where `leg_r` and `leg_l` both take the one `legs` layer) would put every pixel of that layer on its one limb, so each of its parts would hold a piece of both legs; when the set's layer holds more than one island (8-connected pixels with alpha above 8) of at least 1 % of its largest (issue #608: the ghost clean-up's own share; a smaller island is a speck, which goes with the island nearest it — the one holding the pixel centre nearest one of the speck's, none when two are equally near — and is never an island of its own), each segment part keeps the island its joints fall on — its bone's origin and the next segment's bone's origin, at the set's own bones, a joint on the island of a pixel whose square holds the point, and a joint on no island on the one island whose nearest pixel centre lies within the radius of the cap cut at that joint (`cap.radius`: an ankle just past the legwear's edge, on the shoe) — and drops the rest, once its limbs are cut and before the exclusion above, and `assemble` prints `LINT set "<set>" <part>: <layer part> holds <n> islands (8-connected, alpha above 8)[, and <s> speck(s) under 1 % of the largest (<f> px), each with the island nearest it], kept the one under <bone> [x, y] and <bone> [x, y][ (<e> px off it, within its cap's radius <r>)] (<k> px), dropped <m> (<d> px)` per part (k and d count the part's pixels above alpha 8, m the islands it lost one from, and `dropped none` when it lost none); a joint on no island with none or two within that radius, or with no cap cut at it (a limb's first joint), and a segment whose joints fall on two, are refused with `ASSEMBLE_ALT_LIMB_ISLAND` rather than guessed. A layer of one island — specks aside — may hold both legs over each other (a folded shin across the standing leg; issue #609): each of the set's segment parts then keeps the pixels nearer its own limb's segment line — the polyline of only its segments taking that source, their bone origins and the last segment's supplied tip or following segment's joint (issue #638) — than the other limb's, both in the set's pose, and gives the rest away, once its limbs are cut and before the exclusion above; a pixel whose two distances differ by 0.5 px or less (the overlap band: half a pixel, the reach by which a pixel centre is read as on a line) goes to the limb whose part there is drawn later in the base's draw order, and the `LINT set` line above counts what each part kept, gave and held in the band. The other limb stands where the set's `skeleton` places it — its keypoints place every limb bone of the body-18 table, the other leg's as well as the set's own (its `drawn` and `drawnLength` stay the covered bones') — and never at the base's place: a set that does not place it (a `drawn` set, which may not name a bone it does not cover, or a set with neither) is refused with `ASSEMBLE_ALT_LIMB_POSE` when its layer has art where the base draws that limb, and when it has none nothing says the layer holds it and the layer is cut as before; two limbs whose segment lines run closer than the limb's half-width over most of where their art can meet are refused with `ASSEMBLE_ALT_LIMB_OVERLAP`. A set that carries every limb of the layer is cut as before. For a subset set, where a limb's own source layer holds art (`alpha > 8`) under another layer of that run drawn in front (`alpha > 8`, by the projection's plan/depth order), the limb keeps its own layer pixels through projection, limb cutting, island/nearest-line assignment, base-footprint exclusion, fringe clearing and seam correction (issue #637). Those pixels are occluded, never counted as painting projection; no base footprint or painting colour replaces them. After source-art island/nearest-line assignment, a source-transparent cap pixel is assigned before protection, in both doors: its centre is compared against only the segments taking the recipient's source, at the set's supplied bones (ankle-to-toe for a separate foot source), with the existing 0.5 px overlap band and base draw order. A missing last endpoint is refused with `ASSEMBLE_ALT_LIMB_POSE`; an actual following joint may supply that endpoint, never a guessed point. An unposed other limb with base art beneath these cap pixels is likewise refused; without such overlap the existing compatible path retains the cap without inventing the other limb's pose. A pixel cleared by this assignment is never restored. `CAP_FROM_UPPER` records a copy made before assignment and alone proves no ownership: only a retained copy is protected beneath the upper segment, which is drawn over it. The source-art island selection itself is unchanged. Other retained cap pixels (from the layer or a supplied cap image) are protected under an actual front layer even where the lower source is transparent. Protection follows each assigned piece through exclusion, fringe clearing and seam correction; it never restores a pixel ownership removed. Cap pixels removed during ownership leave their original counts for `excluded_px`, just as excluded pixels do, so the cap ledger describes the written PNG. Target assignment reconciles this ledger even when there are no source-transparent cap candidates and when a direct caller does not request cover protection. Unprotected source pixels still obey the base-footprint exclusion. Missing limb/cap art is never extended or guessed. Base builds and uncovered, unexcluded sets keep their existing bytes. `skeleton` (a pose file path relative to the config's directory, `{"width": W, "height": H, "points": {…}}` with all 18 body-18 keypoints on the canvas, validated by the same rules as `generation.control.skeleton`: `CONFIG_FILE_PRESENT`, `CONFIG_IS_JSON`, `CONFIG_FIELD_TYPE`, `CONFIG_KEY_KNOWN`, `CONFIG_KEY_UNIQUE`, `CONFIG_POSE_CANVAS`, `CONFIG_POSE_KEYPOINTS`, `CONFIG_POSE_IN_CANVAS`) or `drawn` (`{<bone>: <worldDegrees>}`, each bone resolved against `bones`, `CONFIG_NAME_RESOLVES`) declares the posed angles the alternate was painted at (issue #465); when `skeleton` is given, `assemble` derives `drawn` from its 18 keypoints (filtered to covered bones on a subset set, with `drawn` overriding any bone named in both), records both `skeleton` (scaled by `assemble.rig_scale` to rig px) and `drawn` in `parts.json` `alternates` — and, when the skeleton placed the set's limb bones (issue #539), `drawnLength` (`{<bone>: <ratio>}`, each covered table bone's skeleton segment length over its base length, 6 places) and `registration` (`{offset: [dx, dy], scale}`: the similarity without rotation, about the canvas origin, that maps the skeleton's torso — the mean of its shoulders `r_shoulder`/`l_shoulder` to the mean of its hips `r_hip`/`l_hip`, read where the base declares the bone rooted there, `sleeve_*0`/`arm_*0` and `leg_*0` — onto those base bones' origins, 6 places), both also written to `sets.json`; the set's painting must be registered, its torso within 1 rig px and 1 % in scale of the base's, or the set is refused by name before any joint is cut (`ASSEMBLE_ALT_SKELETON_REGISTERED`, with the offset and scale the painting would need) — and the `rig` stage writes `<set>_*` region and mesh attachments in the bone-local frame of `poseRigBonesForDrawn(bones, drawn)` (weighting limb segments directly from `skeleton`'s joint endpoints when `skeleton` is present) and emits `drawn` in `sets.json` so `rig-pose` and `check --set <name>` / `--all-sets` pose the bones at `drawn` without rotating the already-posed art a second time. `front` (issue #664) lists covered limb segment parts the set draws on their **front slot** instead of the base slot: each must be in the set's `parts` and not its `hides`, and listed in some `config.limbs.<limb>.front.parts` (`CONFIG_SET_FRONT`); the set then maps `<part>_front` (never `<part>`) to `<set>_<part>` in `parts.json` and `sets.json` and hides `<part>` (and `<part>_still`), its #587 exclusion counts only base parts drawn after the front slot's target, and keying that part's set on a slot track is refused (`CONFIG_SET_FRONT_KEYED`) — *Front slots (issue #664)* below `layers` optionally maps covered, nonhidden output part names to layer names in their existing source run (issue #666); for example `"layers": {"upperarm_r": "author:raised", "forearm_r": "author:raised"}`. Limb cuts, caps, islands and base exclusions read the selected layer; the base plan stays unchanged. |
|
|
134
|
-
| `assemble.head_face_underfill` | assemble, `assemble --propose-plan` | **authored**, optional (issue #492): `boolean` (`CONFIG_FIELD_TYPE` on any other).
|
|
134
|
+
| `assemble.head_face_underfill` | assemble, `assemble --propose-plan` | **authored**, optional (issue #492): `boolean` (`CONFIG_FIELD_TYPE` on any other). During head-face preparation, when both runs exist and `full:face` has at least `150` opaque run px (`PROPOSE_MIN_PX`), the stage maps `full:face` into the head canvas via `fullLayerToHead` and measures how much of its hole-filled silhouette (`alpha > 8`) is covered by `head:face` (`alpha > 8`). An explicit plan selecting `head:face` is refused when that layer covers less than `75 %` (`HEAD_FACE_COVERAGE_FLOOR`, measured `0.0 %..48.6 %` on hollow/omitted head runs vs `84.8 %..99.6 %` on clean head runs across the 4 public examples and 9-standee corpus), with `SEETHROUGH_HEAD_RUN_HOLLOW`, unless `head_face_underfill: true` is declared. When `head_face_underfill: true` is declared and `head:face` exists (`opaqueRunPx >= 150`), `fullLayerToHead(full:face)` is composited under `head:face` on the head canvas (`alpha = max(headAlpha, fullAlpha)`, RGB blended by `headAlpha / 255`) before `head:face` is placed in rig space (`underfill=<N>px(full:face)` on the `face` part log line and a `face: head_face_underfill composited …` note in `assemble --propose-plan`). The fill restores transparent pixels only and leaves the cut's own edge where it is — a hollow whose edge is not under hair stays visible; follow [Source before scissors](#source-before-scissors) for its source remedy. When `head:face` has fewer than `150` opaque pixels, `SEETHROUGH_HEAD_RUN_HOLLOW` still fires even under `head_face_underfill: true` because the head run omitted the face layer and cannot supply a jawline. The proposer instead selects `full:face` after this refusal when that full-run candidate passes the pixel floor and plausibility guards (issue #863); if it does not, the refusal remains. An assemble plan selecting `full:face` without `head:face` does not prepare the unused head face |
|
|
135
135
|
| `assemble.yield_refused` | assemble | **authored**, optional boolean, default `false` (issue #819; other types: `CONFIG_FIELD_TYPE`). With `true`, an original front projection-core pixel refused at max-channel drift > `DRIFT_LIMIT` (90) can yield when its original source pixel is still opaque. Non-core rim pixels (0 < alpha < `CORE_ALPHA`, 250) on the same 8-connected part body can then yield too (issue #832). Connectivity reads the part support before clearing: the opaque border outside the eroded projection core connects the body to its rim but is not itself newly cleared. A separate rim island without a yielded core seed is unchanged. At every cleared pixel, the actual top-most opaque holder below it (alpha >= 250), after earlier yields, must have colour within 90 of the painting. A deeper matching part cannot bypass an intervening opaque mismatch. This setting also applies to alternate sets. A yielded pixel's alpha becomes 0 and its RGB is not repainted. Accepted own-core pixels in the same connected support within the original yielded core's Gaussian footprint (radius 4 rig pixels), with a matching opaque behind holder, finish to painting RGB while retaining alpha and ownership (issue #841); original refusals, protected samples and replacements are excluded. Away from that footprint projection is unchanged. Merge/ring replacements, samples explicitly kept by `keep_under_occluders`, and pixels outside a derived piece cannot connect a rim or be newly yielded. Front is relative to the matching part behind, so original refusals in another run are eligible even when a different part is the global top holder. The reading proceeds back to front against the current behind pixels; alpha changes do not repaint or create a new matching colour. `yieldReadings` optionally records `finishedProjection` (accepted samples whose RGB changed), and records `yieldedRim` as the rim subset of total `yielded`, skipped core merge/ring/nonopaque/no-match counts and original/final global holders; a yielded pixel also taken by projection closing is omitted from the written `source_px_taken` count. Existing cuts/patches and thresholds are unchanged. The `drift:` line reports `yielded N px` per affected part, even below the drift-body size bar; with the setting off it names `assemble.yield_refused: true` as the conditional remedy. Rebuild and inspect the newly exposed layer in motion before considering any cut; a mismatching or absent behind holder cannot be repaired by this setting. |
|
|
136
136
|
| `assemble.keep_under_occluders` | assemble | **authored**, optional array of unique source part names from `assemble.plan`, default `[]` (issue #825). For each named part, keep its own See-through RGBA where the front-most covering part in the final draw stack has alpha greater than 0 and below `CORE_ALPHA` (250), including a cover in the other run. For an explicitly named part, original alpha 1–8 fringe removed by ghost cleanup also counts as source cover, within its final piece region: those pixels still contributed to the painting. Only original opaque own-layer samples are restored after source projection/closing and protected from later seam re-take; merged/rim, cap, under-fill and authored replacement pixels are excluded. This keeps their existing provenance and makes no holes; fully opaque cover and absent cover keep the old path. Cuts and limb pieces inherit the source part's protection. Unknown names: `CONFIG_NAME_RESOLVES`; duplicates: `CONFIG_PART_UNIQUE`; invalid shape: `CONFIG_FIELD_TYPE`. Inspect the part's own amodal layer first: this handle preserves its existing content and cannot complete a missing pixel. Example: `"keep_under_occluders": ["shin_r"]`. |
|
|
137
137
|
| `limbs` | assemble (the cut and the caps), rig (through `regions`), check (`LIMB_ONE_BONE`) | **proposed** by `propose --keypoints` (issue #349), then checked: `{<limb>: {segments: [{part, from, bone}, {part, from, bone, joint, range?, cap?, edge?, cap_shape?, cut_band?, hybrid?}, …], split?, layout?, front?}}`, the upper segment first. The rule is *Limbs: cut at their joints* below the table. `part` is a new part (`CONFIG_PART_NAME`, `CONFIG_PART_UNIQUE` against the plan, patches, cuts and every other limb part); `from` a plan part or a cut's piece (`CONFIG_NAME_RESOLVES`) — the layer the segment's pixels come from, which is cut into the limb parts and is not itself made: a `meshes` or `regions` entry for it is `CONFIG_NAME_RESOLVES`, and the segments of one limb that take one part are consecutive (`CONFIG_LIMB_FROM_RUN`); `bone` a declared bone, each segment's the child of the one before (`CONFIG_LIMB_BONES_CHAIN`); the upper segment names no `joint`, `range`, `cap`, `edge`, `cap_shape` or `cut_band` (`CONFIG_KEY_KNOWN`), every other names its `joint` (`CONFIG_FIELD_PRESENT`) — the joint is its bone's origin; `range` is `[min, max]` degrees from rest with `min <= 0 <= max` (`CONFIG_LIMB_RANGE`), which `assemble` writes into the lower part's `parts.json` record and `check` poses the joint at — its two ends and its middle — reading the seam there (`SEAM_OVER_RANGE`, issue #360; rig-c needs no rotation limit); `cap` a PNG path relative to the config's directory (`CONFIG_FIELD_TYPE`); `edge` `"feather"` (issue #360), the one value it takes, and `cap_shape` `"disc"` (issue #360) or `"ball"` (issue #579) (`CONFIG_FIELD_TYPE` on any other) — the cut's geometry at that joint, *Limbs: cut at their joints* below; absent, the cut is hard and the cap the layer's half-disc of half the limb's width; `cut_band` a whole number of px, 1 or more (`CONFIG_FIELD_TYPE`), on a segment that takes the segment above's part — between two layers nothing is cut, so a band there is `CONFIG_KEY_KNOWN` — places the cut within that many px of the joint line (issue #360, *Limbs: cut at their joints*); absent, the cut is the joint line. Each limb part is attached like any part — `regions.<part>`, which must be the segment's `bone` (`CONFIG_LIMB_BONE`), or a mesh, which `check` holds to that bone alone (`LIMB_ONE_BONE`). With `limbs`, `assemble` reads `bones` too (`CONFIG_FIELD_PRESENT` without it). Absent, nothing is cut at a joint and no byte of any output moves. Optional `front` (issue #664), `{parts: [<own segment part>, …], after: "<produced part>"}`, gives each named segment a second slot `<part>_front`, empty at setup, placed after `after`'s slot family, for a gesture set to draw on (`CONFIG_FRONT_SCOPE`, `CONFIG_FRONT_NAME`, `CONFIG_FRONT_LAYOUT`; *Front slots (issue #664)* below) |
|
|
@@ -3086,6 +3086,22 @@ full loader before its assemble stage writes anything.
|
|
|
3086
3086
|
6. `rig-parts assemble --propose-plan --source … --full … --head … --config config.json --write-config config.json`
|
|
3087
3087
|
saves `assemble.plan` and `assemble.extend_below_crop`. Config: the
|
|
3088
3088
|
`layers` row, with `head_box`.
|
|
3089
|
+
The proposer prefers the head run for `front hair`, `back hair` and `face`.
|
|
3090
|
+
If that head layer is missing, below `PROPOSE_MIN_PX`, or refused by a plan
|
|
3091
|
+
guard, it takes the full-run layer only when that candidate passes the same
|
|
3092
|
+
pixel floor and plausibility guards (issue #863). A suitable head layer stays
|
|
3093
|
+
selected; these three tags do not use headwear/earwear's 0.8 area preference.
|
|
3094
|
+
Back hair stays behind the body and face; a fallback face precedes head details
|
|
3095
|
+
and front hair; fallback front hair is drawn in front of the face. The note
|
|
3096
|
+
names both rig-pixel areas and the head candidate's failure. Full-run hair is
|
|
3097
|
+
already on the full canvas, so it gets no `extend_below_crop` entry.
|
|
3098
|
+
A hollow-head refusal also permits this validated full-face fallback. Explicit
|
|
3099
|
+
plans selecting `head:face` keep the hollow check and underfill opt-in; a plan
|
|
3100
|
+
selecting `full:face` does not prepare or validate the unused head face.
|
|
3101
|
+
The oversized-layer guard still measures a layer against the other layers'
|
|
3102
|
+
union **in its own run**, after face preparation. Losing supporting head layers
|
|
3103
|
+
can shrink that denominator, and underfill can enlarge the numerator; neither
|
|
3104
|
+
event relaxes the guard or makes a rejected full candidate eligible.
|
|
3089
3105
|
Read `notes`: every layer not planned — each tag a layer of either run holds that no
|
|
3090
3106
|
row takes — is named there once, `<tag>: in no plan row — …`, with why, run by run: the
|
|
3091
3107
|
run holds no such layer; the proposer takes that tag from the other run only
|
|
@@ -4323,6 +4339,18 @@ says why each requirement exists and what breaks without it.
|
|
|
4323
4339
|
|
|
4324
4340
|
### The optional ComfyUI adapter (`comfy paint`, `comfy seethrough`)
|
|
4325
4341
|
|
|
4342
|
+
`rig-parts comfy seethrough --image <png> --out <dir> --host <url> --config <config.json>`
|
|
4343
|
+
reads `seethrough.resolution`, `.steps`, `.seed` and `.offload` through the early
|
|
4344
|
+
layers config loader. Explicit `--resolution`, `--steps`, `--seed` and
|
|
4345
|
+
`--offload` / `--no-offload` win over config values; the two offload switches
|
|
4346
|
+
cannot be combined. The resolved resolution must be an integer of at least 64,
|
|
4347
|
+
including config values; `--resolution 64` overrides a smaller configured
|
|
4348
|
+
resolution for this run. Without `--config`, the defaults are resolution 1024,
|
|
4349
|
+
steps 30, seed 42 and offload false. No config is discovered automatically,
|
|
4350
|
+
even beside the command. The command prints every resolved value's source and,
|
|
4351
|
+
when no config is loaded, names `--config <config.json>` as the route to use
|
|
4352
|
+
those settings. Changing a config seed alone cannot change a no-config run.
|
|
4353
|
+
|
|
4326
4354
|
| rule | means | change |
|
|
4327
4355
|
| --- | --- | --- |
|
|
4328
4356
|
| <a id="COMFY_HOST_GIVEN"></a><a id="COMFY_REACHABLE"></a><a id="COMFY_REQUEST_OK"></a>`COMFY_HOST_GIVEN`, `COMFY_REACHABLE`, `COMFY_REQUEST_OK` | no `--host`/`COMFY_HOST`, nothing answering there, or a non-200 answer | the host, or the box |
|
|
@@ -4346,8 +4374,8 @@ says why each requirement exists and what breaks without it.
|
|
|
4346
4374
|
| <a id="ASSEMBLE_SINGLE_RUN_PLAN"></a>`ASSEMBLE_SINGLE_RUN_PLAN` | with no `--head`, a plan row takes `"head"`, or an `extend_below_crop` entry continues a part below a crop there is not | `"full"` in the row; remove the entry |
|
|
4347
4375
|
| <a id="ASSEMBLE_SINGLE_RUN_HEAD_BOX"></a>`ASSEMBLE_SINGLE_RUN_HEAD_BOX` | with no `--head`, the config sets `seethrough.head_box`, which places a head run there is not | remove `head_box`, or give the head run with `--head` |
|
|
4348
4376
|
| <a id="ASSEMBLE_ARM_SPLIT_CUTS_ARM"></a>`ASSEMBLE_ARM_SPLIT_CUTS_ARM` | `seethrough.arm_split` cuts a horizontal opaque run of the arm layer into more than two segments (issue #439; the detail gives the row, the run and the split x) | `seethrough.arm_split`: move `x` or `line` so each horizontal opaque run of the arm layer is split at most once |
|
|
4349
|
-
| <a id="SEETHROUGH_ARM_RUN_MERGED"></a>`SEETHROUGH_ARM_RUN_MERGED` | a full-run `handwear-r` or `handwear-l` layer merges sleeve, bare hand (`>= 40` skin run px around `<s>_wrist`, `GHOST_MIN_AREA`) and overgarment into one arm layer with non-skin pixels reaching more than `1.0x` the forearm length (`<s>_elbow -> <s>_wrist`) below `<s>_wrist` (measured `-0.15x..0.45x` on the 6 clean standees vs `1.25x..2.02x` on the 3 merged standees), and the sleeve above `<s>_wrist` and the drape below `<s>_wrist` have Euclidean RGB distance `< 80` (`ARM_DRAPE_COLOR_DISTANCE`, measured `20.8..28.2` when same-coloured vs `103.6..236.0` when distinct) so the stage cannot split them by colour (issue #490; the detail gives the hand px, the non-skin span, the forearm length and both RGB medians) | follow [Source before scissors](#source-before-scissors): select another layer/run, then a tighter run, then correct depth/role; if no separate source exists and sleeve and overgarment must move independently, a structural `author:` layer or `assemble.cuts` entry separates them |
|
|
4350
|
-
| <a id="SEETHROUGH_HEAD_RUN_HOLLOW"></a>`SEETHROUGH_HEAD_RUN_HOLLOW` | `full:face` has at least `
|
|
4377
|
+
| <a id="SEETHROUGH_ARM_RUN_MERGED"></a>`SEETHROUGH_ARM_RUN_MERGED` | a full-run `handwear-r` or `handwear-l` layer merges sleeve, bare hand (`>= 40` skin run px around `<s>_wrist`, `GHOST_MIN_AREA`) and overgarment into one arm layer with non-skin pixels reaching more than `1.0x` the forearm length (`<s>_elbow -> <s>_wrist`) below `<s>_wrist` (measured `-0.15x..0.45x` on the 6 clean standees vs `1.25x..2.02x` on the 3 merged standees), and the sleeve above `<s>_wrist` and the drape below `<s>_wrist` have Euclidean RGB distance `< 80` (`ARM_DRAPE_COLOR_DISTANCE`, measured `20.8..28.2` when same-coloured vs `103.6..236.0` when distinct) so the stage cannot split them by colour (issue #490; the detail gives the hand px, the non-skin span, the forearm length and both RGB medians) | follow [Source before scissors](#source-before-scissors): select another layer/run, then a tighter run (`comfy seethrough --config <config.json>` to read changed `seethrough` settings, or explicit `--seed <n>`), then correct depth/role; if no separate source exists and sleeve and overgarment must move independently, a structural `author:` layer or `assemble.cuts` entry separates them |
|
|
4378
|
+
| <a id="SEETHROUGH_HEAD_RUN_HOLLOW"></a>`SEETHROUGH_HEAD_RUN_HOLLOW` | `full:face` has at least `150` opaque run px (`PROPOSE_MIN_PX`) and `head:face` covers less than `75 %` (`HEAD_FACE_COVERAGE_FLOOR`, measured `0.0 %..48.6 %` on hollow/omitted head runs vs `84.8 %..99.6 %` on clean head runs across the 4 public examples and 9-standee corpus) of `fullLayerToHead(full:face)`'s hole-filled silhouette (`alpha > 8`) in the head canvas while `config.assemble.head_face_underfill: true` is not declared, or `head:face` has fewer than `150` opaque pixels so there is no head-run `face` layer to under-fill (issue #492; the detail gives the full-run mapped count, the head-run overlap and upper/lower half shares) | `assemble --propose-plan` falls back to `full:face` when it passes the pixel floor and plausibility guards (issue #863); explicit `head:face` plans still refuse. Re-propose and rebuild, change `config.seethrough.seed` and re-run `comfy seethrough --config <config.json>` (or pass `--seed <n>`), or set `config.assemble.head_face_underfill: true` when `head:face` exists so the stage composites `fullLayerToHead(full:face)` under `head:face` on the head canvas (the fill restores transparent pixels only and leaves the cut's own edge where it is — a hollow whose edge is not under hair stays visible; follow [Source before scissors](#source-before-scissors) for its source remedy) |
|
|
4351
4379
|
| <a id="ASSEMBLE_PLAN_TAG_IN_RUN"></a><a id="ASSEMBLE_EXTEND_TAG_IN_RUN"></a>`ASSEMBLE_PLAN_TAG_IN_RUN`, `ASSEMBLE_EXTEND_TAG_IN_RUN` | an entry takes a tag its run does not hold (the detail lists what it does hold) | that entry's run or tag |
|
|
4352
4380
|
| <a id="ASSEMBLE_PAINTING_BAND_INSIDE"></a>`ASSEMBLE_PAINTING_BAND_INSIDE` | an extension band reaches past the rig canvas | supply an in-canvas half-open band in rig pixels; no bound is clipped |
|
|
4353
4381
|
| <a id="CONFIG_ORDER_UNIQUE"></a>`CONFIG_ORDER_UNIQUE` | two `assemble.extend_painting` entries declare the same precedence order | give every entry a unique nonnegative safe integer `order`; lower orders claim first, no implicit tie break |
|
package/docs/STABILITY.md
CHANGED
|
@@ -53,7 +53,7 @@ defaults are the help's too, and none is guessed from the art.
|
|
|
53
53
|
| `sheet` | `--source`, `--layers` (repeatable), `--out`; optional `--cell`, `--cols` |
|
|
54
54
|
| `inputs` | `--source`, `--config`, `--out` |
|
|
55
55
|
| `comfy` | `paint`: `--config`, `--out`; optional `--seeds`, `--seed0`, `--host`, `--wait`, `--timeout`, `--poll` |
|
|
56
|
-
| `comfy` | `seethrough`: `--image`, `--out`; optional `--resolution`, `--steps`, `--seed`, `--prefix`, `--offload`, `--lama`, `--nf4`, `--host`, `--wait`, `--timeout`, `--poll`, `--config` (optional depth block), `--depth-run` (`full` or `head`, required with the block) |
|
|
56
|
+
| `comfy` | `seethrough`: `--image`, `--out`; optional `--resolution`, `--steps`, `--seed`, `--prefix`, `--offload`, `--no-offload`, `--lama`, `--nf4`, `--host`, `--wait`, `--timeout`, `--poll`, `--config` (See-through settings and optional depth block), `--depth-run` (`full` or `head`, required with the block) |
|
|
57
57
|
| `assemble` | `--propose-plan` with `--source`, `--full`, `--config`, optional `--head`, `--write-config` (must name `--config` itself, issue #356); or `--source`, `--full`, `--config`, `--out`, optional `--head` (without it, one run: issue #359), `--seam` (near-white, silhouette), `--project` (core, visible), `--alt` (repeatable `<name>=<source>:<full>[:<head>]`, issue #454) |
|
|
58
58
|
| `propose` | `--head-box` with `--full`, `--canvas`; optional `--no-back-hair`, `--write-config` (existing config, issue #356) |
|
|
59
59
|
| `propose` | `--parts`, `--source`, `--out`; optional `--compare` or `--from-config` (one of them), `--keypoints`, `--person` and `--wrist-snap` (each with `--keypoints`), `--full`, `--head` (the turn control's depths; not with `--from-config`), `--grid-rule` (`figure` or `part`, the drafted lattice's spacing; not with `--from-config`), `--cloth` (a config whose `cloth` block is the recipe, issue #364; not with `--from-config`), `--write-config` (existing config for an ordinary proposal, issue #356; a new file with `--cloth`, issue #537; not with `--from-config` — additive: without it nothing `propose` writes changes), `--from` (the config the recipe is changed from, only with `--write-config`, issue #571 — additive: without it nothing `--write-config` writes changes), `--only-missing` (only with `--parts` and `--write-config`, not with `--cloth` or `--from-config`, issue #671 — additive: without it nothing `--write-config` writes changes) |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rig-parts",
|
|
3
|
-
"version": "1.82.
|
|
3
|
+
"version": "1.82.2",
|
|
4
4
|
"description": "AI-authored 2D character parts from one anime painting and its See-through layer decomposition: measured parts, weighted-mesh rig specs, verified through rig-c before anything is written. A CLI for agents that cannot see the image.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/src/assemble.ts
CHANGED
|
@@ -1751,7 +1751,7 @@ export function splitMergedArmRunsWithNotes(
|
|
|
1751
1751
|
object: `the full run (${set.source}) layer "${tag}"`,
|
|
1752
1752
|
detail:
|
|
1753
1753
|
`merges the sleeve, the hand (${handPx} skin px around ${s}_wrist at (${Math.round(wr.x)}, ${Math.round(wr.y)}), rows y=${handMinY}..${handMaxY}) and the overgarment into one arm layer: non-skin pixels reach y=${nonSkinMaxY}, ${spanBelowWrist.toFixed(1)} px (${(spanBelowWrist / forearm).toFixed(2)}x the forearm length ${forearm.toFixed(1)} px from ${s}_elbow to ${s}_wrist) below ${s}_wrist, and the sleeve above ${s}_wrist (rgb(${sleeveRGB.join(', ')})) and the drape below ${s}_wrist (rgb(${drapeShown.join(', ')})) have Euclidean RGB distance ${bestDist.toFixed(1)} (< ${ARM_DRAPE_COLOR_DISTANCE}); ` +
|
|
1754
|
-
`non-skin pixels reaching at most 1.0x the forearm length (${forearm.toFixed(1)} px) below ${s}_wrist, or a sleeve-to-drape Euclidean RGB distance of at least ${ARM_DRAPE_COLOR_DISTANCE} so the stage can split "${tag}" into "drape-${s}", "${tag}" and "hand-${s}", is required —
|
|
1754
|
+
`non-skin pixels reaching at most 1.0x the forearm length (${forearm.toFixed(1)} px) below ${s}_wrist, or a sleeve-to-drape Euclidean RGB distance of at least ${ARM_DRAPE_COLOR_DISTANCE} so the stage can split "${tag}" into "drape-${s}", "${tag}" and "hand-${s}", is required — change config.seethrough.seed and re-run comfy seethrough --config <config.json> (or pass --seed <n>), split the merged layer into author: layers in the full run, or cut the overgarment from the sleeve in config.assemble.cuts`,
|
|
1755
1755
|
});
|
|
1756
1756
|
continue;
|
|
1757
1757
|
}
|
|
@@ -2126,8 +2126,8 @@ function prepareHeadFace(
|
|
|
2126
2126
|
const floorStr = `${(HEAD_FACE_COVERAGE_FLOOR * 100).toFixed(1)}% (HEAD_FACE_COVERAGE_FLOOR = ${HEAD_FACE_COVERAGE_FLOOR})`;
|
|
2127
2127
|
const detail =
|
|
2128
2128
|
headFaceLayer === undefined || headRawOpaquePx < minPx
|
|
2129
|
-
? `${headFaceLayer === undefined ? 'holds no layer "face"' : `holds ${headRawOpaquePx} opaque px (alpha > ${OPAQUE_ALPHA_ABOVE}, below PROPOSE_MIN_PX = ${minPx})`}, covering ${covStr} of the full run's "face" silhouette on the head canvas (${fullOpaqueRunPx} full-run px); at least ${floorStr} is required — the head run omitted the face layer (so config.assemble.head_face_underfill cannot supply a jawline); re-run
|
|
2130
|
-
: `covers ${covStr} of the full run's "face" silhouette on the head canvas (${headRawOpaquePx} head-run px vs ${fullOpaqueRunPx} full-run px) — See-through left bare skin inside the face silhouette transparent; at least ${floorStr} is required — re-run
|
|
2129
|
+
? `${headFaceLayer === undefined ? 'holds no layer "face"' : `holds ${headRawOpaquePx} opaque px (alpha > ${OPAQUE_ALPHA_ABOVE}, below PROPOSE_MIN_PX = ${minPx})`}, covering ${covStr} of the full run's "face" silhouette on the head canvas (${fullOpaqueRunPx} full-run px); at least ${floorStr} is required — the head run omitted the face layer (so config.assemble.head_face_underfill cannot supply a jawline); change config.seethrough.seed and re-run comfy seethrough --config <config.json> (or pass --seed <n>)`
|
|
2130
|
+
: `covers ${covStr} of the full run's "face" silhouette on the head canvas (${headRawOpaquePx} head-run px vs ${fullOpaqueRunPx} full-run px) — See-through left bare skin inside the face silhouette transparent; at least ${floorStr} is required — change config.seethrough.seed and re-run comfy seethrough --config <config.json> (or pass --seed <n>), or set "head_face_underfill": true in config.assemble to composite full:face under head:face on the head canvas`;
|
|
2131
2131
|
refuseIfAny([
|
|
2132
2132
|
{
|
|
2133
2133
|
code: 'SEETHROUGH_HEAD_RUN_HOLLOW',
|
|
@@ -4663,10 +4663,11 @@ export function assemble(input: AssembleInput): AssembleResult {
|
|
|
4663
4663
|
});
|
|
4664
4664
|
const sourcePlan = plan.flatMap(row => [row, ...cutLayerPlan.filter(([name]) => input.cuts.some(c => c.into === name && c.from === row[0]))]);
|
|
4665
4665
|
// Issue #492: in two-run mode, check that head:face covers >= 75% of full:face's silhouette on the head canvas
|
|
4666
|
-
// (after applying head_face_underfill when declared).
|
|
4666
|
+
// (after applying head_face_underfill when declared). A plan selecting full:face does not consume head:face (#863).
|
|
4667
4667
|
const checkHeadFace =
|
|
4668
4668
|
!single &&
|
|
4669
|
-
(plan.some(([, r, t]) => r === 'head' && t === 'face') ||
|
|
4669
|
+
(plan.some(([, r, t]) => r === 'head' && t === 'face') ||
|
|
4670
|
+
(!plan.some(([, r, t]) => r === 'full' && t === 'face') && plan.some(([, r]) => r === 'full') && plan.some(([, r]) => r === 'head')));
|
|
4670
4671
|
const headFacePrep = checkHeadFace
|
|
4671
4672
|
? prepareHeadFace(full, depthHeadInput, frame, input.resolution, input.headFaceUnderfill === true)
|
|
4672
4673
|
: { head: single ? full : depthHeadInput, underfillPx: 0, underfillNote: null };
|
|
@@ -6027,6 +6028,9 @@ export const PROPOSE_HEAD_TAGS: readonly string[] = [
|
|
|
6027
6028
|
'eyebrow-l',
|
|
6028
6029
|
];
|
|
6029
6030
|
|
|
6031
|
+
/** #863: prefer suitable head layers; only unusable head candidates may fall back for these tags. */
|
|
6032
|
+
const HEAD_FALLBACK_TAGS: readonly string[] = ['back hair', 'face', 'front hair'];
|
|
6033
|
+
|
|
6030
6034
|
/** The part name the reference proposes for a tag; any other tag becomes its own name with spaces and hyphens as underscores. */
|
|
6031
6035
|
export const PROPOSE_ALIAS: Readonly<Record<string, string>> = {
|
|
6032
6036
|
'back hair': 'hair_back',
|
|
@@ -6075,7 +6079,12 @@ function fmt0(v: number): string {
|
|
|
6075
6079
|
* head run, the rest from the full run. Order, back to front: `back hair`;
|
|
6076
6080
|
* the body layers in the full run's draw order, with `neck` placed just before
|
|
6077
6081
|
* the first of topwear, bottomwear or neckwear; then the remaining head layers
|
|
6078
|
-
* in the head run's draw order.
|
|
6082
|
+
* in the head run's draw order. Missing, below-floor or guard-refused head
|
|
6083
|
+
* `back hair`, `face` and `front hair` use a full-run candidate only if it
|
|
6084
|
+
* passes the same floor and plausibility guards (#863); back hair stays
|
|
6085
|
+
* behind the body, face before head details, front hair in front of the face.
|
|
6086
|
+
* A suitable head candidate is retained. Every fallback names the two rig
|
|
6087
|
+
* areas and the reason. A `headwear`/`earwear` the head run drops or
|
|
6079
6088
|
* shrinks (its rig-pixel area below 0.8 of the full run's) is taken from the
|
|
6080
6089
|
* full run instead, drawn right after `back hair` — noted. `front hair` and
|
|
6081
6090
|
* `back hair` taken from the head run are extended below the crop from the
|
|
@@ -6163,15 +6172,27 @@ export function proposePlan(full0: LayerSet, head0: LayerSet, g: Geometry, minPx
|
|
|
6163
6172
|
// Issue #490: when generation.control.skeleton is present, split merged arm layers (or refuse when sleeve and drape share one colour).
|
|
6164
6173
|
const mergedSplit = g.keySkeleton === undefined ? { set: fullArmSplit, notes: [] as string[] } : splitMergedArmRunsWithNotes(fullArmSplit, g.resolution, frame, g.sourceW, g.sourceH, g.keySkeleton);
|
|
6165
6174
|
const full = mergedSplit.set;
|
|
6166
|
-
|
|
6167
|
-
const
|
|
6168
|
-
|
|
6169
|
-
|
|
6170
|
-
|
|
6175
|
+
const fullLayers = runLayers(full, g.resolution);
|
|
6176
|
+
const fullFigures = layerFigures(full);
|
|
6177
|
+
// A hollow head face must not block a usable full-run candidate before selection (#863).
|
|
6178
|
+
// Preserve every other preparation refusal, and preserve this one when the full candidate fails.
|
|
6179
|
+
let headFaceRefusal: Problem | null = null;
|
|
6180
|
+
let headFacePrep = { head: g.single === true ? full : head0, underfillPx: 0, underfillNote: null as string | null };
|
|
6181
|
+
if (g.single !== true) {
|
|
6182
|
+
try {
|
|
6183
|
+
headFacePrep = prepareHeadFace(full, head0, frame, g.resolution, g.headFaceUnderfill === true, minPx);
|
|
6184
|
+
} catch (err) {
|
|
6185
|
+
const face = fullLayers.find(l => l.tag === 'face');
|
|
6186
|
+
const f = fullFigures.find(l => l.name === 'face');
|
|
6187
|
+
if (!(err instanceof PartsError) || err.problems.length !== 1 || err.problems[0].code !== 'SEETHROUGH_HEAD_RUN_HOLLOW' ||
|
|
6188
|
+
face === undefined || face.opaqueRunPx < minPx || f === undefined || implausibleRules(f).length > 0) throw err;
|
|
6189
|
+
headFaceRefusal = err.problems[0];
|
|
6190
|
+
}
|
|
6191
|
+
}
|
|
6171
6192
|
const head = headFacePrep.head;
|
|
6172
|
-
const runs = { full:
|
|
6193
|
+
const runs = { full: fullLayers, head: runLayers(head, g.resolution) };
|
|
6173
6194
|
const find = (run: Run, tag: string): RunLayer | undefined => runs[run].find((l) => l.tag === tag);
|
|
6174
|
-
const figures: Record<Run, LayerFigures[]> = { full:
|
|
6195
|
+
const figures: Record<Run, LayerFigures[]> = { full: fullFigures, head: layerFigures(head) };
|
|
6175
6196
|
const dropNotes: string[] = [];
|
|
6176
6197
|
const noted = new Set<string>();
|
|
6177
6198
|
/** The plausibility rules `run:tag` crosses; the first time a consulted layer crosses any, a note says so. */
|
|
@@ -6188,13 +6209,20 @@ export function proposePlan(full0: LayerSet, head0: LayerSet, g: Geometry, minPx
|
|
|
6188
6209
|
const ok = (run: Run, tag: string): boolean => {
|
|
6189
6210
|
const l = find(run, tag);
|
|
6190
6211
|
const floor = ARM_MERGED_SPLIT_TAGS.some((p) => tag === `${p}-r` || tag === `${p}-l`) ? 1 : minPx;
|
|
6191
|
-
return tag !== 'nose' &&
|
|
6212
|
+
return tag !== 'nose' && !(run === 'head' && tag === 'face' && headFaceRefusal !== null) &&
|
|
6213
|
+
l !== undefined && l.opaqueRunPx >= floor && !implausible(run, tag, 'not proposed');
|
|
6192
6214
|
};
|
|
6193
6215
|
const body = runs.full.filter((l) => !PROPOSE_HEAD_TAGS.includes(l.tag) && ok('full', l.tag)).map((l) => l.tag);
|
|
6194
6216
|
// Issue #256: an author-made layer is proposed from the run that holds it, at its place in that run's draw order,
|
|
6195
6217
|
// like any layer; one both runs hold is proposed once, from the full run when the full run's is proposed, and the note says so.
|
|
6196
6218
|
const authorBoth = runs.head.filter((l) => readAuthorTag(l.tag) !== null && body.includes(l.tag)).map((l) => l.tag);
|
|
6197
6219
|
const heads = runs.head.filter((l) => (PROPOSE_HEAD_TAGS.includes(l.tag) || (readAuthorTag(l.tag) !== null && !authorBoth.includes(l.tag))) && ok('head', l.tag)).map((l) => l.tag);
|
|
6220
|
+
const fallback = new Set(HEAD_FALLBACK_TAGS.filter(t => !ok('head', t) && ok('full', t)));
|
|
6221
|
+
// Full-run back hair stays behind the body; face precedes head details, front hair follows the face.
|
|
6222
|
+
if (fallback.has('back hair')) heads.unshift('back hair');
|
|
6223
|
+
if (fallback.has('face')) heads.unshift('face');
|
|
6224
|
+
if (fallback.has('front hair')) heads.push('front hair');
|
|
6225
|
+
const headRun = (t: string): Run => fallback.has(t) ? 'full' : 'head';
|
|
6198
6226
|
const hw = body.filter((t) => t.startsWith('handwear'));
|
|
6199
6227
|
const plan: PlanEntry[] = [];
|
|
6200
6228
|
const drop = (t: string): void => {
|
|
@@ -6202,7 +6230,7 @@ export function proposePlan(full0: LayerSet, head0: LayerSet, g: Geometry, minPx
|
|
|
6202
6230
|
if (i >= 0) heads.splice(i, 1);
|
|
6203
6231
|
};
|
|
6204
6232
|
if (heads.includes('back hair')) {
|
|
6205
|
-
plan.push([PROPOSE_ALIAS['back hair'], '
|
|
6233
|
+
plan.push([PROPOSE_ALIAS['back hair'], headRun('back hair'), 'back hair']);
|
|
6206
6234
|
drop('back hair');
|
|
6207
6235
|
}
|
|
6208
6236
|
let neckDone = !heads.includes('neck');
|
|
@@ -6217,6 +6245,20 @@ export function proposePlan(full0: LayerSet, head0: LayerSet, g: Geometry, minPx
|
|
|
6217
6245
|
const notes: string[] = [...mergedSplit.notes, ...(headFacePrep.underfillNote === null ? [] : [headFacePrep.underfillNote])];
|
|
6218
6246
|
const headArea = (frame.headK * frame.S) ** 2;
|
|
6219
6247
|
const fullArea = (frame.fullK * frame.S) ** 2;
|
|
6248
|
+
for (const t of HEAD_FALLBACK_TAGS) {
|
|
6249
|
+
if (!fallback.has(t)) continue;
|
|
6250
|
+
const hl = find('head', t);
|
|
6251
|
+
const hp = (hl?.opaqueRunPx ?? 0) * headArea;
|
|
6252
|
+
const fp = (find('full', t)?.opaqueRunPx ?? 0) * fullArea;
|
|
6253
|
+
const f = figures.head.find(l => l.name === t);
|
|
6254
|
+
const reason = t === 'face' && headFaceRefusal !== null
|
|
6255
|
+
? `${headFaceRefusal.code}: ${headFaceRefusal.detail}`
|
|
6256
|
+
: hl === undefined ? 'missing layer'
|
|
6257
|
+
: hl.opaqueRunPx < minPx ? `${hl.opaqueRunPx} run px below ${minPx} (PROPOSE_MIN_PX)`
|
|
6258
|
+
: (f === undefined ? [] : implausibleRules(f)).join(', ');
|
|
6259
|
+
const draw = t === 'back hair' ? 'behind the body and face' : t === 'face' ? 'before head details and front hair' : 'in front of the face';
|
|
6260
|
+
notes.push(`${t}: head run ${fmt0(hp)} rig px (${reason}); full run ${fmt0(fp)} rig px -> full-run layer, drawn ${draw}`);
|
|
6261
|
+
}
|
|
6220
6262
|
for (const t of ['headwear', 'earwear']) {
|
|
6221
6263
|
const hl = find('head', t);
|
|
6222
6264
|
const fl = find('full', t);
|
|
@@ -6229,7 +6271,7 @@ export function proposePlan(full0: LayerSet, head0: LayerSet, g: Geometry, minPx
|
|
|
6229
6271
|
notes.push(`${t}: head run ${fmt0(hp)} rig px < 0.8 x full run ${fmt0(fp)} -> full-run layer, drawn behind the face`);
|
|
6230
6272
|
}
|
|
6231
6273
|
}
|
|
6232
|
-
for (const t of heads) plan.push([aliasOf(t),
|
|
6274
|
+
for (const t of heads) plan.push([aliasOf(t), headRun(t), t]);
|
|
6233
6275
|
for (const [part, run, tag] of plan) {
|
|
6234
6276
|
if (readAuthorTag(tag) !== null) notes.push(`${tag}: ${AUTHOR_NO_ROLE}; proposed as "${part}" from the ${run} run, at its place in that run's draw order`);
|
|
6235
6277
|
}
|
|
@@ -6373,7 +6415,7 @@ function unplannedNotes(
|
|
|
6373
6415
|
if (l === undefined) return `${run} run: no layer`;
|
|
6374
6416
|
const px = `${run} run: ${l.opaqueRunPx} px`;
|
|
6375
6417
|
const headTag = PROPOSE_HEAD_TAGS.includes(tag);
|
|
6376
|
-
const fallback = tag === 'headwear' || tag === 'earwear';
|
|
6418
|
+
const fallback = tag === 'headwear' || tag === 'earwear' || HEAD_FALLBACK_TAGS.includes(tag);
|
|
6377
6419
|
if (run === 'full' && headTag && !fallback) return `${px}, but the proposer takes ${tag} from the head run only (PROPOSE_HEAD_TAGS, src/assemble.ts)`;
|
|
6378
6420
|
if (run === 'head' && !headTag && readAuthorTag(tag) === null) return `${px}, but the proposer takes ${tag} from the full run only (it is not one of PROPOSE_HEAD_TAGS, src/assemble.ts)`;
|
|
6379
6421
|
if (l.opaqueRunPx < minPx) return `${px}, empty: below ${floor}`;
|
|
@@ -6381,6 +6423,7 @@ function unplannedNotes(
|
|
|
6381
6423
|
const f = figures[run].find((x) => x.name === tag) as LayerFigures;
|
|
6382
6424
|
return `${px}, crosses ${implausibleRules(f).join(', ')} (named with its figures in the note below)`;
|
|
6383
6425
|
}
|
|
6426
|
+
if (run === 'full' && HEAD_FALLBACK_TAGS.includes(tag)) return `${px}, but the proposer retains a suitable head-run layer; full-run fallback requires a missing, below-floor or guard-refused head layer`;
|
|
6384
6427
|
if (run === 'full' && fallback) {
|
|
6385
6428
|
return `${px}, but the proposer takes ${tag} from the full run only when the head run's is below 0.8 of it in rig px (head run ${fmt0(rigPx('head', tag))}, full run ${fmt0(rigPx('full', tag))})`;
|
|
6386
6429
|
}
|