Separate Studio 2 source and canvas and apply size and seed choices
This commit is contained in:
@@ -34,3 +34,17 @@ export function attachHeroReference(g, image) {
|
||||
}
|
||||
return g
|
||||
}
|
||||
/** The shared image builders have their own defaults and megapixel scalers.
|
||||
* Studio 2 must send its already resolved canvas size through those nodes. */
|
||||
export function applyResolvedImageSize(graph, {width,height}) {
|
||||
for (const node of Object.values(graph)) {
|
||||
if (node.class_type === 'ImageScaleToTotalPixels') {
|
||||
node.class_type='ImageScale'
|
||||
node.inputs={image:node.inputs.image,upscale_method:'lanczos',width,height,crop:'disabled'}
|
||||
} else {
|
||||
if (typeof node.inputs?.width === 'number') node.inputs.width=width
|
||||
if (typeof node.inputs?.height === 'number') node.inputs.height=height
|
||||
}
|
||||
}
|
||||
return graph
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user