Blend in kept the model's colour as painted, so a model that paints lighter, darker or warmer left the new area off-tone. Classic's Tone match is no answer on turned pictures: it reads the grey rim a turn leaves on the picture's edge as drift, and its flat offset lifts the black of a dark new area. With Tone match on, blend in now compares the model's version of the strip it redrew with the picture at the same pixels (tone layers over the same clean picture pixels, clipped highlights left out), fits the drift as curves over brightness with a pinned and a free part, checks the fit on held-out tiles, adds a local gain along the edge only when that holds out too, and takes the result back off the model's picture before the blend. Blacks stay black; nothing changes when the check fails, the model kept the colours, or there is no feather to read. A clip is measured once. Classic is unchanged (its pins), and blend in at Tone match 0 is pinned to the 2.4.0 stitch. The card no longer dims Tone match under blend in.
46 lines
1.7 KiB
JavaScript
46 lines
1.7 KiB
JavaScript
// Stitch Inpaint's Seam choice as its widget card shows it: the data and
|
|
// decisions only (tests/stitch_seam.test.mjs); js/widget_cards/index.js
|
|
// builds the DOM.
|
|
//
|
|
// Seam has no row on the card. A gear in the card's top-right corner opens a
|
|
// menu that sets it, a "blend in" chip beside the gear shows it at a glance,
|
|
// and blend in mutes Fix edge halo, the one row only the classic seam reads:
|
|
// it stays in place, dimmed, so the node keeps its height in either mode.
|
|
// Tone match works in both seams.
|
|
|
|
// The backend's choices, in its order; the first is the default.
|
|
export const SEAM_CHOICES = ["classic", "blend in"];
|
|
|
|
// The gear menu (js/shared/settings_menu.mjs). persist: false - the choice
|
|
// belongs to this node and is never a default for new ones.
|
|
export const SEAM_MENU = [
|
|
{
|
|
key: "seam",
|
|
label: "Seam",
|
|
type: "choice",
|
|
options: SEAM_CHOICES,
|
|
default: SEAM_CHOICES[0],
|
|
persist: false,
|
|
hint: "How the new area joins your picture. Stored on this node.",
|
|
optionHints: {
|
|
classic: "the feathered paste older workflows use, with Tone match.",
|
|
"blend in": "for outpaints and turned pictures; Tone match still works.",
|
|
},
|
|
},
|
|
];
|
|
|
|
export function isBlendIn(values) {
|
|
return values?.seam === "blend in";
|
|
}
|
|
|
|
// Hover hints on the rows blend in does not read.
|
|
export const SEAM_MUTE_TITLES = {
|
|
fix_edge_halo: "Blend in doesn't use Fix edge halo. Switch Seam back to classic in the gear menu to use it.",
|
|
};
|
|
|
|
// Room the corner tools take from every row's control, so the controls keep
|
|
// one right edge: the gear alone, or the gear with the chip and its note.
|
|
export function seamCornerReserve(values) {
|
|
return isBlendIn(values) ? 84 : 30;
|
|
}
|