feat(ui): handle random seeds

This commit is contained in:
psychedelicious 2023-04-02 18:41:54 +10:00
parent eda334bc34
commit f9c243d29f

View File

@ -29,13 +29,14 @@ export function buildTxt2ImgNode(
cfgScale: cfg_scale, cfgScale: cfg_scale,
sampler, sampler,
seamless, seamless,
shouldRandomizeSeed,
} = generation; } = generation;
// missing fields in TextToImageInvocation: strength, hires_fix // missing fields in TextToImageInvocation: strength, hires_fix
return { return {
type: 'txt2img', type: 'txt2img',
prompt, prompt,
seed, seed: shouldRandomizeSeed ? -1 : seed,
steps, steps,
width, width,
height, height,
@ -66,12 +67,13 @@ export function buildImg2ImgNode(
img2imgStrength: strength, img2imgStrength: strength,
shouldFitToWidthHeight: fit, shouldFitToWidthHeight: fit,
initialImage, initialImage,
shouldRandomizeSeed,
} = generation; } = generation;
return { return {
type: 'img2img', type: 'img2img',
prompt, prompt,
seed, seed: shouldRandomizeSeed ? -1 : seed,
steps, steps,
width, width,
height, height,