fix(ui): use spandrel node for upscaling

This commit is contained in:
psychedelicious 2024-07-19 13:36:05 +10:00
parent 3126e8e49a
commit d0265e21b0
2 changed files with 5 additions and 6 deletions

View File

@ -1,13 +1,11 @@
import type { RootState } from 'app/store/store';
import type { GraphType } from 'features/nodes/util/graph/generation/Graph';
import { Graph } from 'features/nodes/util/graph/generation/Graph';
import { isParamESRGANModelName } from 'features/parameters/store/postprocessingSlice';
import { assert } from 'tsafe';
import {
CLIP_SKIP,
CONTROL_NET_COLLECT,
ESRGAN,
IMAGE_TO_LATENTS,
LATENTS_TO_IMAGE,
MAIN_MODEL_LOADER,
@ -16,6 +14,7 @@ import {
POSITIVE_CONDITIONING,
RESIZE,
SDXL_MODEL_LOADER,
SPANDREL,
TILED_MULTI_DIFFUSION_DENOISE_LATENTS,
UNSHARP_MASK,
VAE_LOADER,
@ -33,7 +32,6 @@ export const buildMultidiffusionUpscsaleGraph = async (state: RootState): Promis
assert(model, 'No model found in state');
assert(upscaleModel, 'No upscale model found in state');
assert(upscaleInitialImage, 'No initial image found in state');
assert(isParamESRGANModelName(upscaleModel.name), 'Model must be valid upscale model');
assert(scale, 'Scale is required');
assert(tileControlnetModel, 'Tile controlnet is required');
@ -48,9 +46,9 @@ export const buildMultidiffusionUpscsaleGraph = async (state: RootState): Promis
});
const upscaleNode = g.addNode({
id: ESRGAN,
type: 'esrgan',
model_name: upscaleModel.name,
id: SPANDREL,
type: 'spandrel_image_to_image',
image_to_image_model: upscaleModel,
tile_size: 500,
});

View File

@ -37,6 +37,7 @@ export const IP_ADAPTER_COLLECT = 'ip_adapter_collect';
export const T2I_ADAPTER_COLLECT = 't2i_adapter_collect';
export const METADATA = 'core_metadata';
export const ESRGAN = 'esrgan';
export const SPANDREL = 'spandrel';
export const SDXL_MODEL_LOADER = 'sdxl_model_loader';
export const SDXL_DENOISE_LATENTS = 'sdxl_denoise_latents';
export const SDXL_REFINER_MODEL_LOADER = 'sdxl_refiner_model_loader';