fix(ui): conflicts after rebasing

This commit is contained in:
psychedelicious 2024-07-24 19:46:51 +10:00
parent c220dd8987
commit 592eb2886c
7 changed files with 11 additions and 12 deletions

View File

@ -7,7 +7,6 @@ import type { ImageDTO } from 'services/api/types';
import { isSpandrelImageToImageModelConfig } from 'services/api/types'; import { isSpandrelImageToImageModelConfig } from 'services/api/types';
import { assert } from 'tsafe'; import { assert } from 'tsafe';
import { getModelMetadataField } from './canvas/metadata';
import { SPANDREL } from './constants'; import { SPANDREL } from './constants';
type Arg = { type Arg = {
@ -33,7 +32,7 @@ export const buildAdHocPostProcessingGraph = async ({ image, state }: Arg): Prom
const modelConfig = await fetchModelConfigWithTypeGuard(postProcessingModel.key, isSpandrelImageToImageModelConfig); const modelConfig = await fetchModelConfigWithTypeGuard(postProcessingModel.key, isSpandrelImageToImageModelConfig);
g.upsertMetadata({ g.upsertMetadata({
upscale_model: getModelMetadataField(modelConfig), upscale_model: Graph.getModelMetadataField(modelConfig),
}); });
return g.getGraph(); return g.getGraph();

View File

@ -1,6 +1,6 @@
import type { RootState } from 'app/store/store'; import type { RootState } from 'app/store/store';
import { fetchModelConfigWithTypeGuard } from 'features/metadata/util/modelFetchingHelpers'; import { fetchModelConfigWithTypeGuard } from 'features/metadata/util/modelFetchingHelpers';
import type { GraphType } from 'features/nodes/util/graph/generation/Graph'; import { addSDXLLoRAs } from 'features/nodes/util/graph/generation/addSDXLLoRAs';
import { Graph } from 'features/nodes/util/graph/generation/Graph'; import { Graph } from 'features/nodes/util/graph/generation/Graph';
import { isNonRefinerMainModelConfig, isSpandrelImageToImageModelConfig } from 'services/api/types'; import { isNonRefinerMainModelConfig, isSpandrelImageToImageModelConfig } from 'services/api/types';
import { assert } from 'tsafe'; import { assert } from 'tsafe';
@ -21,11 +21,10 @@ import {
VAE_LOADER, VAE_LOADER,
} from './constants'; } from './constants';
import { addLoRAs } from './generation/addLoRAs'; import { addLoRAs } from './generation/addLoRAs';
import { addSDXLLoRas } from './generation/addSDXLLoRAs';
import { getBoardField, getPresetModifiedPrompts } from './graphBuilderUtils'; import { getBoardField, getPresetModifiedPrompts } from './graphBuilderUtils';
export const buildMultidiffusionUpscaleGraph = async (state: RootState): Promise<GraphType> => { export const buildMultidiffusionUpscaleGraph = async (state: RootState): Promise<Graph> => {
const { model, cfgScale: cfg_scale, scheduler, steps, vaePrecision, seed, vae } = state.generation; const { model, cfgScale: cfg_scale, scheduler, steps, vaePrecision, seed, vae } = state.canvasV2.params;
const { upscaleModel, upscaleInitialImage, structure, creativity, tileControlnetModel, scale } = state.upscale; const { upscaleModel, upscaleInitialImage, structure, creativity, tileControlnetModel, scale } = state.upscale;
assert(model, 'No model found in state'); assert(model, 'No model found in state');
@ -123,7 +122,7 @@ export const buildMultidiffusionUpscaleGraph = async (state: RootState): Promise
g.addEdge(modelNode, 'clip2', posCondNode, 'clip2'); g.addEdge(modelNode, 'clip2', posCondNode, 'clip2');
g.addEdge(modelNode, 'clip2', negCondNode, 'clip2'); g.addEdge(modelNode, 'clip2', negCondNode, 'clip2');
g.addEdge(modelNode, 'unet', tiledMultidiffusionNode, 'unet'); g.addEdge(modelNode, 'unet', tiledMultidiffusionNode, 'unet');
addSDXLLoRas(state, g, tiledMultidiffusionNode, modelNode, null, posCondNode, negCondNode); addSDXLLoRAs(state, g, tiledMultidiffusionNode, modelNode, null, posCondNode, negCondNode);
g.upsertMetadata({ g.upsertMetadata({
positive_prompt: positivePrompt, positive_prompt: positivePrompt,
@ -245,5 +244,5 @@ export const buildMultidiffusionUpscaleGraph = async (state: RootState): Promise
g.addEdge(collectNode, 'collection', tiledMultidiffusionNode, 'control'); g.addEdge(collectNode, 'collection', tiledMultidiffusionNode, 'control');
return g.getGraph(); return g;
}; };

View File

@ -600,7 +600,7 @@ describe('Graph', () => {
}); });
g.upsertMetadata({ test: 'test' }); g.upsertMetadata({ test: 'test' });
g.addEdgeToMetadata(n1, 'width', 'width'); g.addEdgeToMetadata(n1, 'width', 'width');
const metadata = g._getMetadataNode(); const metadata = g.getMetadataNode();
expect(g.getEdgesFrom(n1).length).toBe(1); expect(g.getEdgesFrom(n1).length).toBe(1);
expect(g.getEdgesTo(metadata as unknown as AnyInvocation).length).toBe(1); expect(g.getEdgesTo(metadata as unknown as AnyInvocation).length).toBe(1);
}); });

View File

@ -409,7 +409,7 @@ export class Graph {
metadataField: string metadataField: string
): Edge { ): Edge {
// @ts-expect-error `Graph` excludes `core_metadata` nodes due to its excessively wide typing // @ts-expect-error `Graph` excludes `core_metadata` nodes due to its excessively wide typing
return this.addEdge(fromNode, fromField, this._getMetadataNode(), metadataField); return this.addEdge(fromNode, fromField, this.getMetadataNode(), metadataField);
} }
/** /**
* Set the node that should receive metadata. All other edges from the metadata node are deleted. * Set the node that should receive metadata. All other edges from the metadata node are deleted.

View File

@ -54,7 +54,7 @@ export const AdvancedSettingsAccordion = memo(() => {
if (params.seamlessXAxis || params.seamlessYAxis) { if (params.seamlessXAxis || params.seamlessYAxis) {
badges.push('seamless'); badges.push('seamless');
} }
if (activeTabName === 'upscaling' && !generation.shouldRandomizeSeed) { if (activeTabName === 'upscaling' && !params.shouldRandomizeSeed) {
badges.push('Manual Seed'); badges.push('Manual Seed');
} }
return badges; return badges;

View File

@ -10,7 +10,7 @@ import { useControlNetModels } from 'services/api/hooks/modelsByType';
export const UpscaleWarning = () => { export const UpscaleWarning = () => {
const { t } = useTranslation(); const { t } = useTranslation();
const model = useAppSelector((s) => s.generation.model); const model = useAppSelector((s) => s.canvasV2.params.model);
const upscaleModel = useAppSelector((s) => s.upscale.upscaleModel); const upscaleModel = useAppSelector((s) => s.upscale.upscaleModel);
const tileControlnetModel = useAppSelector((s) => s.upscale.tileControlnetModel); const tileControlnetModel = useAppSelector((s) => s.upscale.tileControlnetModel);
const upscaleInitialImage = useAppSelector((s) => s.upscale.upscaleInitialImage); const upscaleInitialImage = useAppSelector((s) => s.upscale.upscaleInitialImage);

View File

@ -20,6 +20,7 @@ const overlayScrollbarsStyles: CSSProperties = {
const ParametersPanelUpscale = () => { const ParametersPanelUpscale = () => {
const isMenuOpen = useStore($isMenuOpen); const isMenuOpen = useStore($isMenuOpen);
return ( return (
<Flex w="full" h="full" flexDir="column" gap={2}> <Flex w="full" h="full" flexDir="column" gap={2}>
<QueueControls /> <QueueControls />