mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix creativity/sharpness/structure scales, move where loras are added, get scale const working
This commit is contained in:
parent
d166b08b6a
commit
fb4b3f3350
@ -23,7 +23,7 @@ import { addLoRAs } from './generation/addLoRAs';
|
||||
import { addSDXLLoRas } from './generation/addSDXLLoRAs';
|
||||
import { getBoardField, getSDXLStylePrompts } from './graphBuilderUtils';
|
||||
|
||||
const SCALE = 2;
|
||||
export const UPSCALE_SCALE = 2;
|
||||
|
||||
export const buildMultidiffusionUpscsaleGraph = async (state: RootState): Promise<GraphType> => {
|
||||
const { model, cfgScale: cfg_scale, scheduler, steps, vaePrecision, seed, vae } = state.generation;
|
||||
@ -67,8 +67,8 @@ export const buildMultidiffusionUpscsaleGraph = async (state: RootState): Promis
|
||||
const resizeNode = g.addNode({
|
||||
id: RESIZE,
|
||||
type: 'img_resize',
|
||||
width: ((upscaleInitialImage.width * SCALE) / 8) * 8,
|
||||
height: ((upscaleInitialImage.height * SCALE) / 8) * 8,
|
||||
width: ((upscaleInitialImage.width * UPSCALE_SCALE) / 8) * 8,
|
||||
height: ((upscaleInitialImage.height * UPSCALE_SCALE) / 8) * 8,
|
||||
resample_mode: 'lanczos',
|
||||
});
|
||||
|
||||
@ -142,6 +142,7 @@ export const buildMultidiffusionUpscsaleGraph = async (state: RootState): Promis
|
||||
g.addEdge(modelNode, 'clip', negCondNode, 'clip');
|
||||
g.addEdge(modelNode, 'clip2', posCondNode, 'clip2');
|
||||
g.addEdge(modelNode, 'clip2', negCondNode, 'clip2');
|
||||
g.addEdge(modelNode, 'unet', tiledMultidiffusionNode, 'unet');
|
||||
addSDXLLoRas(state, g, tiledMultidiffusionNode, modelNode, null, posCondNode, negCondNode);
|
||||
} else {
|
||||
posCondNode = g.addNode({
|
||||
@ -167,6 +168,7 @@ export const buildMultidiffusionUpscsaleGraph = async (state: RootState): Promis
|
||||
g.addEdge(modelNode, 'clip', clipSkipNode, 'clip');
|
||||
g.addEdge(clipSkipNode, 'clip', posCondNode, 'clip');
|
||||
g.addEdge(clipSkipNode, 'clip', negCondNode, 'clip');
|
||||
g.addEdge(modelNode, 'unet', tiledMultidiffusionNode, 'unet');
|
||||
addLoRAs(state, g, tiledMultidiffusionNode, modelNode, null, clipSkipNode, posCondNode, negCondNode);
|
||||
}
|
||||
|
||||
@ -186,7 +188,7 @@ export const buildMultidiffusionUpscsaleGraph = async (state: RootState): Promis
|
||||
g.addEdge(i2lNode, 'latents', tiledMultidiffusionNode, 'latents');
|
||||
g.addEdge(posCondNode, 'conditioning', tiledMultidiffusionNode, 'positive_conditioning');
|
||||
g.addEdge(negCondNode, 'conditioning', tiledMultidiffusionNode, 'negative_conditioning');
|
||||
g.addEdge(modelNode, 'unet', tiledMultidiffusionNode, 'unet');
|
||||
|
||||
g.addEdge(tiledMultidiffusionNode, 'latents', l2iNode, 'latents');
|
||||
|
||||
const controlnetNode1 = g.addNode({
|
||||
|
@ -7,10 +7,10 @@ import { useTranslation } from 'react-i18next';
|
||||
const ParamCreativity = () => {
|
||||
const creativity = useAppSelector((s) => s.upscale.creativity);
|
||||
const initial = 0;
|
||||
const sliderMin = -5;
|
||||
const sliderMax = 5;
|
||||
const numberInputMin = -5;
|
||||
const numberInputMax = 5;
|
||||
const sliderMin = -10;
|
||||
const sliderMax = 10;
|
||||
const numberInputMin = -10;
|
||||
const numberInputMax = 10;
|
||||
const coarseStep = 1;
|
||||
const fineStep = 1;
|
||||
const dispatch = useAppDispatch();
|
||||
|
@ -7,10 +7,10 @@ import { useTranslation } from 'react-i18next';
|
||||
const ParamSharpness = () => {
|
||||
const sharpness = useAppSelector((s) => s.upscale.sharpness);
|
||||
const initial = 0;
|
||||
const sliderMin = -5;
|
||||
const sliderMax = 5;
|
||||
const numberInputMin = -5;
|
||||
const numberInputMax = 5;
|
||||
const sliderMin = -10;
|
||||
const sliderMax = 10;
|
||||
const numberInputMin = -10;
|
||||
const numberInputMax = 10;
|
||||
const coarseStep = 1;
|
||||
const fineStep = 1;
|
||||
const dispatch = useAppDispatch();
|
||||
|
@ -7,10 +7,10 @@ import { useTranslation } from 'react-i18next';
|
||||
const ParamStructure = () => {
|
||||
const structure = useAppSelector((s) => s.upscale.structure);
|
||||
const initial = 0;
|
||||
const sliderMin = -5;
|
||||
const sliderMax = 5;
|
||||
const numberInputMin = -5;
|
||||
const numberInputMax = 5;
|
||||
const sliderMin = -10;
|
||||
const sliderMax = 10;
|
||||
const numberInputMin = -10;
|
||||
const numberInputMax = 10;
|
||||
const coarseStep = 1;
|
||||
const fineStep = 1;
|
||||
const dispatch = useAppDispatch();
|
||||
|
@ -2,16 +2,17 @@ import { Flex, Text } from '@invoke-ai/ui-library';
|
||||
import { useAppSelector } from 'app/store/storeHooks';
|
||||
import { useMemo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { UPSCALE_SCALE } from '../../../nodes/util/graph/buildMultidiffusionUpscaleGraph';
|
||||
|
||||
export const UpscaleSizeDetails = () => {
|
||||
const { t } = useTranslation();
|
||||
const { upscaleInitialImage, scale } = useAppSelector((s) => s.upscale);
|
||||
const { upscaleInitialImage } = useAppSelector((s) => s.upscale);
|
||||
|
||||
const outputSizeText = useMemo(() => {
|
||||
if (upscaleInitialImage && scale) {
|
||||
return `${t('upscaling.outputImageSize')}: ${upscaleInitialImage.width * scale} ${t('upscaling.x')} ${upscaleInitialImage.height * scale}`;
|
||||
if (upscaleInitialImage) {
|
||||
return `${t('upscaling.outputImageSize')}: ${upscaleInitialImage.width * UPSCALE_SCALE} ${t('upscaling.x')} ${upscaleInitialImage.height * UPSCALE_SCALE}`;
|
||||
}
|
||||
}, [upscaleInitialImage, scale, t]);
|
||||
}, [upscaleInitialImage, t]);
|
||||
|
||||
if (!outputSizeText || !upscaleInitialImage) {
|
||||
return <></>;
|
||||
|
Loading…
Reference in New Issue
Block a user