diff --git a/invokeai/app/invocations/model.py b/invokeai/app/invocations/model.py index c3dde5e725..548ff3cb4b 100644 --- a/invokeai/app/invocations/model.py +++ b/invokeai/app/invocations/model.py @@ -249,7 +249,7 @@ class SDXLLoraLoaderInvocation(BaseInvocation): """Apply selected lora to unet and text_encoder.""" lora: LoRAModelField = InputField(description=FieldDescriptions.lora_model, input=Input.Direct, title="LoRA") - weight: float = Field(default=0.75, description=FieldDescriptions.lora_weight) + weight: float = InputField(default=0.75, description=FieldDescriptions.lora_weight) unet: Optional[UNetField] = Field( default=None, description=FieldDescriptions.unet, input=Input.Connection, title="UNET" ) diff --git a/invokeai/backend/util/mps_fixes.py b/invokeai/backend/util/mps_fixes.py index 8a4e6baab5..ce21d33b88 100644 --- a/invokeai/backend/util/mps_fixes.py +++ b/invokeai/backend/util/mps_fixes.py @@ -1,7 +1,7 @@ import math -import torch -import diffusers +import diffusers +import torch if torch.backends.mps.is_available(): torch.empty = torch.zeros diff --git a/invokeai/frontend/web/src/features/controlNet/components/ControlNetImagePreview.tsx b/invokeai/frontend/web/src/features/controlNet/components/ControlNetImagePreview.tsx index d3ab3c3817..d2c37445a3 100644 --- a/invokeai/frontend/web/src/features/controlNet/components/ControlNetImagePreview.tsx +++ b/invokeai/frontend/web/src/features/controlNet/components/ControlNetImagePreview.tsx @@ -104,22 +104,22 @@ const ControlNetImagePreview = ({ isSmall, controlNet }: Props) => { ]); const handleSetControlImageToDimensions = useCallback(() => { - if (!processedControlImage) { + if (!controlImage) { return; } if (activeTabName === 'unifiedCanvas') { dispatch( setBoundingBoxDimensions({ - width: processedControlImage.width, - height: processedControlImage.height, + width: controlImage.width, + height: controlImage.height, }) ); } else { - dispatch(setWidth(processedControlImage.width)); - dispatch(setHeight(processedControlImage.height)); + dispatch(setWidth(controlImage.width)); + dispatch(setHeight(controlImage.height)); } - }, [processedControlImage, activeTabName, dispatch]); + }, [controlImage, activeTabName, dispatch]); const handleMouseEnter = useCallback(() => { setIsMouseOverImage(true); diff --git a/invokeai/frontend/web/src/features/nodes/types/types.ts b/invokeai/frontend/web/src/features/nodes/types/types.ts index 7783393d6f..a2de44cb38 100644 --- a/invokeai/frontend/web/src/features/nodes/types/types.ts +++ b/invokeai/frontend/web/src/features/nodes/types/types.ts @@ -1,4 +1,3 @@ -import { store } from 'app/store/store'; import { SchedulerParam, zBaseModel, @@ -10,7 +9,6 @@ import { keyBy } from 'lodash-es'; import { OpenAPIV3 } from 'openapi-types'; import { RgbaColor } from 'react-colorful'; import { Node } from 'reactflow'; -import { JsonObject } from 'type-fest'; import { Graph, ImageDTO, _InputField, _OutputField } from 'services/api/types'; import { AnyInvocationType, @@ -18,6 +16,7 @@ import { ProgressImage, } from 'services/events/types'; import { O } from 'ts-toolbelt'; +import { JsonObject } from 'type-fest'; import { z } from 'zod'; export type NonNullableGraph = O.Required; @@ -936,22 +935,10 @@ export const zWorkflow = z.object({ }); export const zValidatedWorkflow = zWorkflow.transform((workflow) => { - const nodeTemplates = store.getState().nodes.nodeTemplates; const { nodes, edges } = workflow; const warnings: WorkflowWarning[] = []; const invocationNodes = nodes.filter(isWorkflowInvocationNode); const keyedNodes = keyBy(invocationNodes, 'id'); - invocationNodes.forEach((node, i) => { - const nodeTemplate = nodeTemplates[node.data.type]; - if (!nodeTemplate) { - warnings.push({ - message: `Node "${node.data.label || node.data.id}" skipped`, - issues: [`Unable to find template for type "${node.data.type}"`], - data: node, - }); - delete nodes[i]; - } - }); edges.forEach((edge, i) => { const sourceNode = keyedNodes[edge.source]; const targetNode = keyedNodes[edge.target];