mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
chore(ui): lint
This commit is contained in:
parent
f5d0721fa8
commit
2f345d1976
@ -76,11 +76,11 @@ const IAICanvasGrid = () => {
|
||||
};
|
||||
|
||||
const // find the x & y size of the grid
|
||||
xSize = gridFullRect.x2 - gridFullRect.x1,
|
||||
ySize = gridFullRect.y2 - gridFullRect.y1,
|
||||
// compute the number of steps required on each axis.
|
||||
xSteps = Math.round(xSize / gridSpacing) + 1,
|
||||
ySteps = Math.round(ySize / gridSpacing) + 1;
|
||||
xSize = gridFullRect.x2 - gridFullRect.x1;
|
||||
const ySize = gridFullRect.y2 - gridFullRect.y1;
|
||||
// compute the number of steps required on each axis.
|
||||
const xSteps = Math.round(xSize / gridSpacing) + 1;
|
||||
const ySteps = Math.round(ySize / gridSpacing) + 1;
|
||||
|
||||
const strokeWidth = unscale(1);
|
||||
|
||||
|
@ -13,10 +13,10 @@ const AddModels = () => {
|
||||
return (
|
||||
<Flex flexDirection="column" width="100%" overflow="scroll" maxHeight={window.innerHeight - 250} gap={4}>
|
||||
<ButtonGroup>
|
||||
<Button size="sm" isChecked={addModelMode == 'simple'} onClick={handleAddModelSimple}>
|
||||
<Button size="sm" isChecked={addModelMode === 'simple'} onClick={handleAddModelSimple}>
|
||||
{t('common.simple')}
|
||||
</Button>
|
||||
<Button size="sm" isChecked={addModelMode == 'advanced'} onClick={handleAddModelAdvanced}>
|
||||
<Button size="sm" isChecked={addModelMode === 'advanced'} onClick={handleAddModelAdvanced}>
|
||||
{t('common.advanced')}
|
||||
</Button>
|
||||
</ButtonGroup>
|
||||
|
@ -17,16 +17,16 @@ const ImportModelsPanel = () => {
|
||||
return (
|
||||
<Flex flexDirection="column" gap={4} h="full">
|
||||
<ButtonGroup>
|
||||
<Button onClick={handleClickAddTab} isChecked={addModelTab == 'add'} size="sm" width="100%">
|
||||
<Button onClick={handleClickAddTab} isChecked={addModelTab === 'add'} size="sm" width="100%">
|
||||
{t('modelManager.addModel')}
|
||||
</Button>
|
||||
<Button onClick={handleClickScanTab} isChecked={addModelTab == 'scan'} size="sm" width="100%" isDisabled>
|
||||
<Button onClick={handleClickScanTab} isChecked={addModelTab === 'scan'} size="sm" width="100%" isDisabled>
|
||||
{t('modelManager.scanForModels')}
|
||||
</Button>
|
||||
</ButtonGroup>
|
||||
|
||||
{addModelTab == 'add' && <AddModels />}
|
||||
{addModelTab == 'scan' && <ScanModels />}
|
||||
{addModelTab === 'add' && <AddModels />}
|
||||
{addModelTab === 'scan' && <ScanModels />}
|
||||
</Flex>
|
||||
);
|
||||
};
|
||||
|
@ -58,11 +58,11 @@ const AddNodePopover = () => {
|
||||
// If we have a connection in progress, we need to filter the node choices
|
||||
const filteredNodeTemplates = fieldFilter
|
||||
? filter(nodeTemplates.templates, (template) => {
|
||||
const handles = handleFilter == 'source' ? template.inputs : template.outputs;
|
||||
const handles = handleFilter === 'source' ? template.inputs : template.outputs;
|
||||
|
||||
return some(handles, (handle) => {
|
||||
const sourceType = handleFilter == 'source' ? fieldFilter : handle.type;
|
||||
const targetType = handleFilter == 'target' ? fieldFilter : handle.type;
|
||||
const sourceType = handleFilter === 'source' ? fieldFilter : handle.type;
|
||||
const targetType = handleFilter === 'target' ? fieldFilter : handle.type;
|
||||
|
||||
return validateSourceAndTargetTypes(sourceType, targetType);
|
||||
});
|
||||
|
@ -50,16 +50,16 @@ export const findConnectionToValidHandle = (
|
||||
return null;
|
||||
}
|
||||
|
||||
const handles = handleCurrentType == 'source' ? node.data.inputs : node.data.outputs;
|
||||
const handles = handleCurrentType === 'source' ? node.data.inputs : node.data.outputs;
|
||||
|
||||
//Prioritize handles whos name matches the node we're coming from
|
||||
if (handles[handleCurrentName]) {
|
||||
const handle = handles[handleCurrentName];
|
||||
|
||||
const sourceID = handleCurrentType == 'source' ? handleCurrentNodeId : node.id;
|
||||
const targetID = handleCurrentType == 'source' ? node.id : handleCurrentNodeId;
|
||||
const sourceHandle = handleCurrentType == 'source' ? handleCurrentName : handle.name;
|
||||
const targetHandle = handleCurrentType == 'source' ? handle.name : handleCurrentName;
|
||||
const sourceID = handleCurrentType === 'source' ? handleCurrentNodeId : node.id;
|
||||
const targetID = handleCurrentType === 'source' ? node.id : handleCurrentNodeId;
|
||||
const sourceHandle = handleCurrentType === 'source' ? handleCurrentName : handle.name;
|
||||
const targetHandle = handleCurrentType === 'source' ? handle.name : handleCurrentName;
|
||||
|
||||
const isGraphAcyclic = getIsGraphAcyclic(sourceID, targetID, nodes, edges);
|
||||
|
||||
@ -78,10 +78,10 @@ export const findConnectionToValidHandle = (
|
||||
for (const handleName in handles) {
|
||||
const handle = handles[handleName];
|
||||
|
||||
const sourceID = handleCurrentType == 'source' ? handleCurrentNodeId : node.id;
|
||||
const targetID = handleCurrentType == 'source' ? node.id : handleCurrentNodeId;
|
||||
const sourceHandle = handleCurrentType == 'source' ? handleCurrentName : handle.name;
|
||||
const targetHandle = handleCurrentType == 'source' ? handle.name : handleCurrentName;
|
||||
const sourceID = handleCurrentType === 'source' ? handleCurrentNodeId : node.id;
|
||||
const targetID = handleCurrentType === 'source' ? node.id : handleCurrentNodeId;
|
||||
const sourceHandle = handleCurrentType === 'source' ? handleCurrentName : handle.name;
|
||||
const targetHandle = handleCurrentType === 'source' ? handle.name : handleCurrentName;
|
||||
|
||||
const isGraphAcyclic = getIsGraphAcyclic(sourceID, targetID, nodes, edges);
|
||||
|
||||
|
@ -175,7 +175,7 @@ export const addHrfToGraph = (state: RootState, graph: NonNullableGraph): void =
|
||||
width: width,
|
||||
height: height,
|
||||
};
|
||||
if (hrfMethod == 'ESRGAN') {
|
||||
if (hrfMethod === 'ESRGAN') {
|
||||
let model_name: ESRGANInvocation['model_name'] = 'RealESRGAN_x2plus.pth';
|
||||
if ((width * height) / (hrfWidth * hrfHeight) > 2) {
|
||||
model_name = 'RealESRGAN_x4plus.pth';
|
||||
|
@ -96,7 +96,7 @@ export const addSeamlessToLinearGraph = (
|
||||
);
|
||||
|
||||
if (
|
||||
graph.id == CANVAS_INPAINT_GRAPH ||
|
||||
graph.id === CANVAS_INPAINT_GRAPH ||
|
||||
graph.id === CANVAS_OUTPAINT_GRAPH ||
|
||||
graph.id === SDXL_CANVAS_INPAINT_GRAPH ||
|
||||
graph.id === SDXL_CANVAS_OUTPAINT_GRAPH
|
||||
|
@ -70,7 +70,7 @@ export const addVAEToGraph = (
|
||||
graph.id === CANVAS_TEXT_TO_IMAGE_GRAPH ||
|
||||
graph.id === CANVAS_IMAGE_TO_IMAGE_GRAPH ||
|
||||
graph.id === SDXL_CANVAS_TEXT_TO_IMAGE_GRAPH ||
|
||||
graph.id == SDXL_CANVAS_IMAGE_TO_IMAGE_GRAPH
|
||||
graph.id === SDXL_CANVAS_IMAGE_TO_IMAGE_GRAPH
|
||||
) {
|
||||
graph.edges.push({
|
||||
source: {
|
||||
|
Loading…
Reference in New Issue
Block a user