More Translations and Fixes

This commit is contained in:
mickr777
2023-09-15 13:43:32 +10:00
parent a1ef079d1f
commit 7481251127
26 changed files with 199 additions and 167 deletions

View File

@ -1,5 +1,5 @@
import { FieldType, FieldUIConfig } from './types';
import i18n from 'i18next';
import { t } from 'i18next';
export const HANDLE_TOOLTIP_OPEN_DELAY = 500;
export const COLOR_TOKEN_VALUE = 500;
@ -103,73 +103,73 @@ export const isPolymorphicItemType = (
export const FIELDS: Record<FieldType, FieldUIConfig> = {
boolean: {
color: 'green.500',
description: i18n.t('nodes.booleanDescription'),
title: i18n.t('nodes.boolean'),
description: t('nodes.booleanDescription'),
title: t('nodes.boolean'),
},
BooleanCollection: {
color: 'green.500',
description: i18n.t('nodes.booleanCollectionDescription'),
title: i18n.t('nodes.booleanCollection'),
description: t('nodes.booleanCollectionDescription'),
title: t('nodes.booleanCollection'),
},
BooleanPolymorphic: {
color: 'green.500',
description: i18n.t('nodes.booleanPolymorphicDescription'),
title: i18n.t('nodes.booleanPolymorphic'),
description: t('nodes.booleanPolymorphicDescription'),
title: t('nodes.booleanPolymorphic'),
},
ClipField: {
color: 'green.500',
description: i18n.t('nodes.clipFieldDescription'),
title: i18n.t('nodes.clipField'),
description: t('nodes.clipFieldDescription'),
title: t('nodes.clipField'),
},
Collection: {
color: 'base.500',
description: i18n.t('nodes.collectionDescription'),
title: i18n.t('nodes.collection'),
description: t('nodes.collectionDescription'),
title: t('nodes.collection'),
},
CollectionItem: {
color: 'base.500',
description: i18n.t('nodes.collectionItemDescription'),
title: i18n.t('nodes.collectionItem'),
description: t('nodes.collectionItemDescription'),
title: t('nodes.collectionItem'),
},
ColorCollection: {
color: 'pink.300',
description: i18n.t('nodes.colorCollectionDescription'),
title: i18n.t('nodes.colorCollection'),
description: t('nodes.colorCollectionDescription'),
title: t('nodes.colorCollection'),
},
ColorField: {
color: 'pink.300',
description: i18n.t('nodes.colorFieldDescription'),
title: i18n.t('nodes.colorField'),
description: t('nodes.colorFieldDescription'),
title: t('nodes.colorField'),
},
ColorPolymorphic: {
color: 'pink.300',
description: i18n.t('nodes.colorPolymorphicDescription'),
title: i18n.t('nodes.colorPolymorphic'),
description: t('nodes.colorPolymorphicDescription'),
title: t('nodes.colorPolymorphic'),
},
ConditioningCollection: {
color: 'cyan.500',
description: i18n.t('nodes.conditioningCollectionDescription'),
title: i18n.t('nodes.conditioningCollection'),
description: t('nodes.conditioningCollectionDescription'),
title: t('nodes.conditioningCollection'),
},
ConditioningField: {
color: 'cyan.500',
description: i18n.t('nodes.conditioningFieldDescription'),
title: i18n.t('nodes.conditioningField'),
description: t('nodes.conditioningFieldDescription'),
title: t('nodes.conditioningField'),
},
ConditioningPolymorphic: {
color: 'cyan.500',
description: i18n.t('nodes.conditioningPolymorphicDescription'),
title: i18n.t('nodes.conditioningPolymorphic'),
description: t('nodes.conditioningPolymorphicDescription'),
title: t('nodes.conditioningPolymorphic'),
},
ControlCollection: {
color: 'teal.500',
description: i18n.t('nodes.controlCollectionDescription'),
title: i18n.t('nodes.controlCollection'),
description: t('nodes.controlCollectionDescription'),
title: t('nodes.controlCollection'),
},
ControlField: {
color: 'teal.500',
description: i18n.t('nodes.controlFieldDescription'),
title: i18n.t('nodes.controlField'),
description: t('nodes.controlFieldDescription'),
title: t('nodes.controlField'),
},
ControlNetModelField: {
color: 'teal.500',
@ -183,132 +183,132 @@ export const FIELDS: Record<FieldType, FieldUIConfig> = {
},
DenoiseMaskField: {
color: 'blue.300',
description: i18n.t('nodes.denoiseMaskFieldDescription'),
title: i18n.t('nodes.denoiseMaskField'),
description: t('nodes.denoiseMaskFieldDescription'),
title: t('nodes.denoiseMaskField'),
},
enum: {
color: 'blue.500',
description: i18n.t('nodes.enumDescription'),
title: i18n.t('nodes.enum'),
description: t('nodes.enumDescription'),
title: t('nodes.enum'),
},
float: {
color: 'orange.500',
description: i18n.t('nodes.floatDescription'),
title: i18n.t('nodes.float'),
description: t('nodes.floatDescription'),
title: t('nodes.float'),
},
FloatCollection: {
color: 'orange.500',
description: i18n.t('nodes.floatCollectionDescription'),
title: i18n.t('nodes.floatCollection'),
description: t('nodes.floatCollectionDescription'),
title: t('nodes.floatCollection'),
},
FloatPolymorphic: {
color: 'orange.500',
description: i18n.t('nodes.floatPolymorphicDescription'),
title: i18n.t('nodes.floatPolymorphic'),
description: t('nodes.floatPolymorphicDescription'),
title: t('nodes.floatPolymorphic'),
},
ImageCollection: {
color: 'purple.500',
description: i18n.t('nodes.imageCollectionDescription'),
title: i18n.t('nodes.imageCollection'),
description: t('nodes.imageCollectionDescription'),
title: t('nodes.imageCollection'),
},
ImageField: {
color: 'purple.500',
description: i18n.t('nodes.imageFieldDescription'),
title: i18n.t('nodes.imageField'),
description: t('nodes.imageFieldDescription'),
title: t('nodes.imageField'),
},
ImagePolymorphic: {
color: 'purple.500',
description: i18n.t('nodes.imagePolymorphicDescription'),
title: i18n.t('nodes.imagePolymorphic'),
description: t('nodes.imagePolymorphicDescription'),
title: t('nodes.imagePolymorphic'),
},
integer: {
color: 'red.500',
description: i18n.t('nodes.integerDescription'),
title: i18n.t('nodes.integer'),
description: t('nodes.integerDescription'),
title: t('nodes.integer'),
},
IntegerCollection: {
color: 'red.500',
description: i18n.t('nodes.integerCollectionDescription'),
title: i18n.t('nodes.integerCollection'),
description: t('nodes.integerCollectionDescription'),
title: t('nodes.integerCollection'),
},
IntegerPolymorphic: {
color: 'red.500',
description: i18n.t('nodes.integerPolymorphicDescription'),
title: i18n.t('nodes.integerPolymorphic'),
description: t('nodes.integerPolymorphicDescription'),
title: t('nodes.integerPolymorphic'),
},
LatentsCollection: {
color: 'pink.500',
description: i18n.t('nodes.latentsCollectionDescription'),
title: i18n.t('nodes.latentsCollection'),
description: t('nodes.latentsCollectionDescription'),
title: t('nodes.latentsCollection'),
},
LatentsField: {
color: 'pink.500',
description: i18n.t('nodes.latentsFieldDescription'),
title: i18n.t('nodes.latentsField'),
description: t('nodes.latentsFieldDescription'),
title: t('nodes.latentsField'),
},
LatentsPolymorphic: {
color: 'pink.500',
description: i18n.t('nodes.latentsPolymorphicDescription'),
title: i18n.t('nodes.latentsPolymorphic'),
description: t('nodes.latentsPolymorphicDescription'),
title: t('nodes.latentsPolymorphic'),
},
LoRAModelField: {
color: 'teal.500',
description: i18n.t('nodes.loRAModelFieldDescription'),
title: i18n.t('nodes.loRAModelField'),
description: t('nodes.loRAModelFieldDescription'),
title: t('nodes.loRAModelField'),
},
MainModelField: {
color: 'teal.500',
description: i18n.t('nodes.mainModelFieldDescription'),
title: i18n.t('nodes.mainModelField'),
description: t('nodes.mainModelFieldDescription'),
title: t('nodes.mainModelField'),
},
ONNXModelField: {
color: 'teal.500',
description: i18n.t('nodes.oNNXModelFieldDescription'),
title: i18n.t('nodes.oNNXModelField'),
description: t('nodes.oNNXModelFieldDescription'),
title: t('nodes.oNNXModelField'),
},
Scheduler: {
color: 'base.500',
description: i18n.t('nodes.schedulerDescription'),
title: i18n.t('nodes.scheduler'),
description: t('nodes.schedulerDescription'),
title: t('nodes.scheduler'),
},
SDXLMainModelField: {
color: 'teal.500',
description: i18n.t('nodes.sDXLMainModelFieldDescription'),
title: i18n.t('nodes.sDXLMainModelField'),
description: t('nodes.sDXLMainModelFieldDescription'),
title: t('nodes.sDXLMainModelField'),
},
SDXLRefinerModelField: {
color: 'teal.500',
description: i18n.t('nodes.sDXLRefinerModelFieldDescription'),
title: i18n.t('nodes.sDXLRefinerModelField'),
description: t('nodes.sDXLRefinerModelFieldDescription'),
title: t('nodes.sDXLRefinerModelField'),
},
string: {
color: 'yellow.500',
description: i18n.t('nodes.stringDescription'),
title: i18n.t('nodes.string'),
description: t('nodes.stringDescription'),
title: t('nodes.string'),
},
StringCollection: {
color: 'yellow.500',
description: i18n.t('nodes.stringCollectionDescription'),
title: i18n.t('nodes.stringCollection'),
description: t('nodes.stringCollectionDescription'),
title: t('nodes.stringCollection'),
},
StringPolymorphic: {
color: 'yellow.500',
description: i18n.t('nodes.stringPolymorphicDescription'),
title: i18n.t('nodes.stringPolymorphic'),
description: t('nodes.stringPolymorphicDescription'),
title: t('nodes.stringPolymorphic'),
},
UNetField: {
color: 'red.500',
description: i18n.t('nodes.uNetFieldDescription'),
title: i18n.t('nodes.uNetField'),
description: t('nodes.uNetFieldDescription'),
title: t('nodes.uNetField'),
},
VaeField: {
color: 'blue.500',
description: i18n.t('nodes.vaeFieldDescription'),
title: i18n.t('nodes.vaeField'),
description: t('nodes.vaeFieldDescription'),
title: t('nodes.vaeField'),
},
VaeModelField: {
color: 'teal.500',
description: i18n.t('nodes.vaeModelFieldDescription'),
title: i18n.t('nodes.vaeModelField'),
description: t('nodes.vaeModelFieldDescription'),
title: t('nodes.vaeModelField'),
},
};

View File

@ -9,7 +9,6 @@ import { buildCanvasSDXLInpaintGraph } from './buildCanvasSDXLInpaintGraph';
import { buildCanvasSDXLOutpaintGraph } from './buildCanvasSDXLOutpaintGraph';
import { buildCanvasSDXLTextToImageGraph } from './buildCanvasSDXLTextToImageGraph';
import { buildCanvasTextToImageGraph } from './buildCanvasTextToImageGraph';
import i18n from 'i18next';
export const buildCanvasGraph = (
state: RootState,
@ -30,7 +29,7 @@ export const buildCanvasGraph = (
}
} else if (generationMode === 'img2img') {
if (!canvasInitImage) {
throw new Error(i18n.t('nodes.missingCanvaInitImage'));
throw new Error('Missing canvas init image');
}
if (
state.generation.model &&
@ -42,7 +41,7 @@ export const buildCanvasGraph = (
}
} else if (generationMode === 'inpaint') {
if (!canvasInitImage || !canvasMaskImage) {
throw new Error(i18n.t('nodes.missingCanvaInitMaskImages'));
throw new Error('Missing canvas init and mask images');
}
if (
state.generation.model &&
@ -58,7 +57,7 @@ export const buildCanvasGraph = (
}
} else {
if (!canvasInitImage) {
throw new Error(i18n.t('nodes.missingCanvaInitImage'));
throw new Error('Missing canvas init image');
}
if (
state.generation.model &&
@ -75,4 +74,4 @@ export const buildCanvasGraph = (
}
return graph;
};
};

View File

@ -25,7 +25,6 @@ import {
POSITIVE_CONDITIONING,
SEAMLESS,
} from './constants';
import i18n from 'i18next';
/**
* Builds the Canvas tab's Image to Image graph.
@ -67,8 +66,8 @@ export const buildCanvasImageToImageGraph = (
);
if (!model) {
log.error(i18n.t('nodes.noModelFoundState'));
throw new Error(i18n.t('nodes.noModelFoundState'));
log.error('No model found in state');
throw new Error('No model found in state');
}
let modelLoaderNodeId = MAIN_MODEL_LOADER;

View File

@ -44,7 +44,6 @@ import {
RANGE_OF_SIZE,
SEAMLESS,
} from './constants';
import i18n from 'i18next';
/**
* Builds the Canvas tab's Inpaint graph.
@ -80,8 +79,8 @@ export const buildCanvasInpaintGraph = (
} = state.generation;
if (!model) {
log.error(i18n.t('nodes.noImageFoundState'));
throw new Error(i18n.t('nodes.noImageFoundState'));
log.error('No Image found in state');
throw new Error('No Image found in state');
}
// The bounding box determines width and height, not the width and height params

View File

@ -46,7 +46,6 @@ import {
RANGE_OF_SIZE,
SEAMLESS,
} from './constants';
import i18n from 'i18next';
/**
* Builds the Canvas tab's Outpaint graph.
@ -84,8 +83,8 @@ export const buildCanvasOutpaintGraph = (
} = state.generation;
if (!model) {
log.error(i18n.t('nodes.noImageFoundState'));
throw new Error(i18n.t('nodes.noImageFoundState'));
log.error('No model found in state');
throw new Error('No model found in state');
}
// The bounding box determines width and height, not the width and height params
@ -851,4 +850,4 @@ export const buildCanvasOutpaintGraph = (
}
return graph;
};
};

View File

@ -27,7 +27,6 @@ import {
SEAMLESS,
} from './constants';
import { craftSDXLStylePrompt } from './helpers/craftSDXLStylePrompt';
import i18n from 'i18next';
/**
* Builds the Canvas tab's Image to Image graph.
@ -75,8 +74,8 @@ export const buildCanvasSDXLImageToImageGraph = (
);
if (!model) {
log.error(i18n.t('nodes.noModelFoundState'));
throw new Error(i18n.t('nodes.noModelFoundState'));
log.error('No model found in state');
throw new Error('No model found in state');
}
// Model Loader ID

View File

@ -46,7 +46,6 @@ import {
SEAMLESS,
} from './constants';
import { craftSDXLStylePrompt } from './helpers/craftSDXLStylePrompt';
import i18n from 'i18next';
/**
* Builds the Canvas tab's Inpaint graph.
@ -87,8 +86,8 @@ export const buildCanvasSDXLInpaintGraph = (
} = state.sdxl;
if (!model) {
log.error(i18n.t('nodes.noModelFoundState'));
throw new Error(i18n.t('nodes.noModelFoundState'));
log.error('No model found in state');
throw new Error('No model found in state');
}
// The bounding box determines width and height, not the width and height params

View File

@ -48,7 +48,6 @@ import {
SEAMLESS,
} from './constants';
import { craftSDXLStylePrompt } from './helpers/craftSDXLStylePrompt';
import i18n from 'i18next';
/**
* Builds the Canvas tab's Outpaint graph.
@ -91,8 +90,8 @@ export const buildCanvasSDXLOutpaintGraph = (
} = state.sdxl;
if (!model) {
log.error(i18n.t('nodes.noModelFoundState'));
throw new Error(i18n.t('nodes.noModelFoundState'));
log.error('No model found in state');
throw new Error('No model found in state');
}
// The bounding box determines width and height, not the width and height params

View File

@ -29,7 +29,6 @@ import {
SEAMLESS,
} from './constants';
import { craftSDXLStylePrompt } from './helpers/craftSDXLStylePrompt';
import i18n from 'i18next';
/**
* Builds the Canvas tab's Text to Image graph.
@ -72,8 +71,8 @@ export const buildCanvasSDXLTextToImageGraph = (
state.sdxl;
if (!model) {
log.error(i18n.t('nodes.noModelFoundState'));
throw new Error(i18n.t('nodes.noModelFoundState'));
log.error('No model found in state');
throw new Error('No model found in state');
}
const use_cpu = shouldUseNoiseSettings

View File

@ -27,7 +27,6 @@ import {
POSITIVE_CONDITIONING,
SEAMLESS,
} from './constants';
import i18n from 'i18next';
/**
* Builds the Canvas tab's Text to Image graph.
@ -67,8 +66,8 @@ export const buildCanvasTextToImageGraph = (
);
if (!model) {
log.error(i18n.t('nodes.noModelFoundState'));
throw new Error(i18n.t('nodes.noModelFoundState'));
log.error('No model found in state');
throw new Error('No model found in state');
}
const use_cpu = shouldUseNoiseSettings

View File

@ -27,7 +27,6 @@ import {
RESIZE,
SEAMLESS,
} from './constants';
import i18n from 'i18next';
/**
* Builds the Image to Image tab graph.
@ -76,13 +75,13 @@ export const buildLinearImageToImageGraph = (
*/
if (!initialImage) {
log.error(i18n.t('nodes.noImageFoundState'));
throw new Error(i18n.t('nodes.noImageFoundState'));
log.error('No initial image found in state');
throw new Error('No initial image found in state');
}
if (!model) {
log.error(i18n.t('nodes.noModelFoundState'));
throw new Error(i18n.t('nodes.noModelFoundState'));
log.error('No model found in state');
throw new Error('No model found in state');
}
const fp32 = vaePrecision === 'fp32';
@ -377,4 +376,4 @@ export const buildLinearImageToImageGraph = (
}
return graph;
};
};

View File

@ -29,7 +29,6 @@ import {
SEAMLESS,
} from './constants';
import { craftSDXLStylePrompt } from './helpers/craftSDXLStylePrompt';
import i18n from 'i18next';
/**
* Builds the Image to Image tab graph.
@ -76,13 +75,13 @@ export const buildLinearSDXLImageToImageGraph = (
*/
if (!initialImage) {
log.error(i18n.t('nodes.noImageFoundState'));
throw new Error(i18n.t('nodes.noImageFoundState'));
log.error('No initial image found in state');
throw new Error('No initial image found in state');
}
if (!model) {
log.error(i18n.t('nodes.noModelFoundState'));
throw new Error(i18n.t('nodes.noModelFoundState'));
log.error('No model found in state');
throw new Error('No model found in state');
}
const fp32 = vaePrecision === 'fp32';
@ -400,4 +399,4 @@ export const buildLinearSDXLImageToImageGraph = (
}
return graph;
};
};

View File

@ -23,7 +23,6 @@ import {
SEAMLESS,
} from './constants';
import { craftSDXLStylePrompt } from './helpers/craftSDXLStylePrompt';
import i18n from 'i18next';
export const buildLinearSDXLTextToImageGraph = (
state: RootState
@ -59,8 +58,8 @@ export const buildLinearSDXLTextToImageGraph = (
: initialGenerationState.shouldUseCpuNoise;
if (!model) {
log.error(i18n.t('nodes.noModelFoundState'));
throw new Error(i18n.t('nodes.noModelFoundState'));
log.error('No model found in state');
throw new Error('No model found in state');
}
const fp32 = vaePrecision === 'fp32';

View File

@ -26,7 +26,6 @@ import {
SEAMLESS,
TEXT_TO_IMAGE_GRAPH,
} from './constants';
import i18n from 'i18next';
export const buildLinearTextToImageGraph = (
state: RootState
@ -54,8 +53,8 @@ export const buildLinearTextToImageGraph = (
: initialGenerationState.shouldUseCpuNoise;
if (!model) {
log.error(i18n.t('nodes.noModelFoundState'));
throw new Error(i18n.t('nodes.noModelFoundState'));
log.error('No model found in state');
throw new Error('No model found in state');
}
const fp32 = vaePrecision === 'fp32';