mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): use control adapter processor helper in metadata parser
This commit is contained in:
parent
2410ed689a
commit
57c1954da7
@ -1,10 +1,9 @@
|
|||||||
import { CONTROLNET_PROCESSORS } from 'features/controlAdapters/store/constants';
|
|
||||||
import { isControlAdapterProcessorType } from 'features/controlAdapters/store/types';
|
|
||||||
import {
|
import {
|
||||||
initialControlNet,
|
initialControlNet,
|
||||||
initialIPAdapter,
|
initialIPAdapter,
|
||||||
initialT2IAdapter,
|
initialT2IAdapter,
|
||||||
} from 'features/controlAdapters/util/buildControlAdapter';
|
} from 'features/controlAdapters/util/buildControlAdapter';
|
||||||
|
import { buildControlAdapterProcessor } from 'features/controlAdapters/util/buildControlAdapterProcessor';
|
||||||
import type { LoRA } from 'features/lora/store/loraSlice';
|
import type { LoRA } from 'features/lora/store/loraSlice';
|
||||||
import { defaultLoRAConfig } from 'features/lora/store/loraSlice';
|
import { defaultLoRAConfig } from 'features/lora/store/loraSlice';
|
||||||
import type {
|
import type {
|
||||||
@ -254,9 +253,7 @@ const parseControlNet: MetadataParseFunc<ControlNetConfigMetadata> = async (meta
|
|||||||
.catch(null)
|
.catch(null)
|
||||||
.parse(getProperty(metadataItem, 'resize_mode'));
|
.parse(getProperty(metadataItem, 'resize_mode'));
|
||||||
|
|
||||||
const defaultPreprocessor = controlNetModel.default_settings?.preprocessor;
|
const { processorType, processorNode } = buildControlAdapterProcessor(controlNetModel);
|
||||||
const processorType = isControlAdapterProcessorType(defaultPreprocessor) ? defaultPreprocessor : 'none';
|
|
||||||
const processorNode = CONTROLNET_PROCESSORS[processorType].default;
|
|
||||||
|
|
||||||
const controlNet: ControlNetConfigMetadata = {
|
const controlNet: ControlNetConfigMetadata = {
|
||||||
type: 'controlnet',
|
type: 'controlnet',
|
||||||
@ -307,9 +304,7 @@ const parseT2IAdapter: MetadataParseFunc<T2IAdapterConfigMetadata> = async (meta
|
|||||||
.catch(null)
|
.catch(null)
|
||||||
.parse(getProperty(metadataItem, 'resize_mode'));
|
.parse(getProperty(metadataItem, 'resize_mode'));
|
||||||
|
|
||||||
const defaultPreprocessor = t2iAdapterModel.default_settings?.preprocessor;
|
const { processorType, processorNode } = buildControlAdapterProcessor(t2iAdapterModel);
|
||||||
const processorType = isControlAdapterProcessorType(defaultPreprocessor) ? defaultPreprocessor : 'none';
|
|
||||||
const processorNode = CONTROLNET_PROCESSORS[processorType].default;
|
|
||||||
|
|
||||||
const t2iAdapter: T2IAdapterConfigMetadata = {
|
const t2iAdapter: T2IAdapterConfigMetadata = {
|
||||||
type: 't2i_adapter',
|
type: 't2i_adapter',
|
||||||
|
Loading…
Reference in New Issue
Block a user