mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
chore: rename DWPose to DW Openpose
This commit is contained in:
committed by
Kent Keirsey
parent
50b93992cf
commit
e82c21b5ba
@ -81,7 +81,7 @@ their descriptions.
|
|||||||
| ONNX Text to Latents | Generates latents from conditionings. |
|
| ONNX Text to Latents | Generates latents from conditionings. |
|
||||||
| ONNX Model Loader | Loads a main model, outputting its submodels. |
|
| ONNX Model Loader | Loads a main model, outputting its submodels. |
|
||||||
| OpenCV Inpaint | Simple inpaint using opencv. |
|
| OpenCV Inpaint | Simple inpaint using opencv. |
|
||||||
| DWPose Processor | Applies Openpose processing to image |
|
| DW Openpose Processor | Applies Openpose processing to image |
|
||||||
| PIDI Processor | Applies PIDI processing to image |
|
| PIDI Processor | Applies PIDI processing to image |
|
||||||
| Prompts from File | Loads prompts from a text file |
|
| Prompts from File | Loads prompts from a text file |
|
||||||
| Random Integer | Outputs a single random integer. |
|
| Random Integer | Outputs a single random integer. |
|
||||||
|
@ -30,7 +30,7 @@ from invokeai.app.invocations.util import validate_begin_end_step, validate_weig
|
|||||||
from invokeai.app.services.image_records.image_records_common import ImageCategory, ResourceOrigin
|
from invokeai.app.services.image_records.image_records_common import ImageCategory, ResourceOrigin
|
||||||
from invokeai.app.shared.fields import FieldDescriptions
|
from invokeai.app.shared.fields import FieldDescriptions
|
||||||
from invokeai.backend.image_util.depth_anything import DepthAnythingDetector
|
from invokeai.backend.image_util.depth_anything import DepthAnythingDetector
|
||||||
from invokeai.backend.image_util.dwpose import DWPoseDetector
|
from invokeai.backend.image_util.dw_openpose import DWOpenposeDetector
|
||||||
|
|
||||||
from ...backend.model_management import BaseModelType
|
from ...backend.model_management import BaseModelType
|
||||||
from .baseinvocation import (
|
from .baseinvocation import (
|
||||||
@ -611,13 +611,13 @@ class DepthAnythingImageProcessorInvocation(ImageProcessorInvocation):
|
|||||||
|
|
||||||
|
|
||||||
@invocation(
|
@invocation(
|
||||||
"dwpose_image_processor",
|
"dw_openpose_image_processor",
|
||||||
title="DWPose Image Processor",
|
title="DW Openpose Image Processor",
|
||||||
tags=["controlnet", "dwpose", "openpose"],
|
tags=["controlnet", "dwpose", "openpose"],
|
||||||
category="controlnet",
|
category="controlnet",
|
||||||
version="1.0.0",
|
version="1.0.0",
|
||||||
)
|
)
|
||||||
class DWPoseImageProcessorInvocation(ImageProcessorInvocation):
|
class DWOpenposeImageProcessorInvocation(ImageProcessorInvocation):
|
||||||
"""Generates an openpose pose from an image using DWPose"""
|
"""Generates an openpose pose from an image using DWPose"""
|
||||||
|
|
||||||
draw_body: bool = InputField(default=True)
|
draw_body: bool = InputField(default=True)
|
||||||
@ -626,8 +626,8 @@ class DWPoseImageProcessorInvocation(ImageProcessorInvocation):
|
|||||||
image_resolution: int = InputField(default=512, ge=0, description=FieldDescriptions.image_res)
|
image_resolution: int = InputField(default=512, ge=0, description=FieldDescriptions.image_res)
|
||||||
|
|
||||||
def run_processor(self, image):
|
def run_processor(self, image):
|
||||||
dwpose = DWPoseDetector()
|
dw_openpose = DWOpenposeDetector()
|
||||||
processed_image = dwpose(
|
processed_image = dw_openpose(
|
||||||
image,
|
image,
|
||||||
draw_face=self.draw_face,
|
draw_face=self.draw_face,
|
||||||
draw_hands=self.draw_hands,
|
draw_hands=self.draw_hands,
|
||||||
|
@ -3,8 +3,8 @@ import torch
|
|||||||
from controlnet_aux.util import resize_image
|
from controlnet_aux.util import resize_image
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
|
||||||
from invokeai.backend.image_util.dwpose.utils import draw_bodypose, draw_facepose, draw_handpose
|
from invokeai.backend.image_util.dw_openpose.utils import draw_bodypose, draw_facepose, draw_handpose
|
||||||
from invokeai.backend.image_util.dwpose.wholebody import Wholebody
|
from invokeai.backend.image_util.dw_openpose.wholebody import Wholebody
|
||||||
|
|
||||||
|
|
||||||
def draw_pose(pose, H, W, draw_face=True, draw_body=True, draw_hands=True, resolution=512):
|
def draw_pose(pose, H, W, draw_face=True, draw_body=True, draw_hands=True, resolution=512):
|
||||||
@ -33,9 +33,9 @@ def draw_pose(pose, H, W, draw_face=True, draw_body=True, draw_hands=True, resol
|
|||||||
return dwpose_image
|
return dwpose_image
|
||||||
|
|
||||||
|
|
||||||
class DWPoseDetector:
|
class DWOpenposeDetector:
|
||||||
"""
|
"""
|
||||||
Code from the original implementation of the DWPose Detector.
|
Code from the original implementation of the DW Openpose Detector.
|
||||||
Credits: https://github.com/IDEA-Research/DWPose
|
Credits: https://github.com/IDEA-Research/DWPose
|
||||||
"""
|
"""
|
||||||
|
|
@ -264,8 +264,8 @@
|
|||||||
"noneDescription": "No processing applied",
|
"noneDescription": "No processing applied",
|
||||||
"normalBae": "Normal BAE",
|
"normalBae": "Normal BAE",
|
||||||
"normalBaeDescription": "Normal BAE processing",
|
"normalBaeDescription": "Normal BAE processing",
|
||||||
"dwPose": "DWPose",
|
"dwOpenpose": "DW Openpose",
|
||||||
"dwPoseDescription": "Human pose estimation using DWPose",
|
"dwOpenposeDescription": "Human pose estimation using DW Openpose",
|
||||||
"pidi": "PIDI",
|
"pidi": "PIDI",
|
||||||
"pidiDescription": "PIDI image processing",
|
"pidiDescription": "PIDI image processing",
|
||||||
"processor": "Processor",
|
"processor": "Processor",
|
||||||
|
@ -6,7 +6,7 @@ import CannyProcessor from './processors/CannyProcessor';
|
|||||||
import ColorMapProcessor from './processors/ColorMapProcessor';
|
import ColorMapProcessor from './processors/ColorMapProcessor';
|
||||||
import ContentShuffleProcessor from './processors/ContentShuffleProcessor';
|
import ContentShuffleProcessor from './processors/ContentShuffleProcessor';
|
||||||
import DepthAnyThingProcessor from './processors/DepthAnyThingProcessor';
|
import DepthAnyThingProcessor from './processors/DepthAnyThingProcessor';
|
||||||
import DWPoseProcessor from './processors/DWPoseProcessor';
|
import DWOpenposeProcessor from './processors/DWOpenposeProcessor';
|
||||||
import HedProcessor from './processors/HedProcessor';
|
import HedProcessor from './processors/HedProcessor';
|
||||||
import LineartAnimeProcessor from './processors/LineartAnimeProcessor';
|
import LineartAnimeProcessor from './processors/LineartAnimeProcessor';
|
||||||
import LineartProcessor from './processors/LineartProcessor';
|
import LineartProcessor from './processors/LineartProcessor';
|
||||||
@ -73,8 +73,8 @@ const ControlAdapterProcessorComponent = ({ id }: Props) => {
|
|||||||
return <NormalBaeProcessor controlNetId={id} processorNode={processorNode} isEnabled={isEnabled} />;
|
return <NormalBaeProcessor controlNetId={id} processorNode={processorNode} isEnabled={isEnabled} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (processorNode.type === 'dwpose_image_processor') {
|
if (processorNode.type === 'dw_openpose_image_processor') {
|
||||||
return <DWPoseProcessor controlNetId={id} processorNode={processorNode} isEnabled={isEnabled} />;
|
return <DWOpenposeProcessor controlNetId={id} processorNode={processorNode} isEnabled={isEnabled} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (processorNode.type === 'pidi_image_processor') {
|
if (processorNode.type === 'pidi_image_processor') {
|
||||||
|
@ -1,22 +1,23 @@
|
|||||||
import { CompositeNumberInput, CompositeSlider, Flex, FormControl, FormLabel, Switch } from '@invoke-ai/ui-library';
|
import { CompositeNumberInput, CompositeSlider, Flex, FormControl, FormLabel, Switch } from '@invoke-ai/ui-library';
|
||||||
import { useProcessorNodeChanged } from 'features/controlAdapters/components/hooks/useProcessorNodeChanged';
|
import { useProcessorNodeChanged } from 'features/controlAdapters/components/hooks/useProcessorNodeChanged';
|
||||||
import { CONTROLNET_PROCESSORS } from 'features/controlAdapters/store/constants';
|
import { CONTROLNET_PROCESSORS } from 'features/controlAdapters/store/constants';
|
||||||
import type { RequiredDWPoseImageProcessorInvocation } from 'features/controlAdapters/store/types';
|
import type { RequiredDWOpenposeImageProcessorInvocation } from 'features/controlAdapters/store/types';
|
||||||
import type { ChangeEvent } from 'react';
|
import type { ChangeEvent } from 'react';
|
||||||
import { memo, useCallback } from 'react';
|
import { memo, useCallback } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import ProcessorWrapper from './common/ProcessorWrapper';
|
import ProcessorWrapper from './common/ProcessorWrapper';
|
||||||
|
|
||||||
const DEFAULTS = CONTROLNET_PROCESSORS.dwpose_image_processor.default as RequiredDWPoseImageProcessorInvocation;
|
const DEFAULTS = CONTROLNET_PROCESSORS.dw_openpose_image_processor
|
||||||
|
.default as RequiredDWOpenposeImageProcessorInvocation;
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
controlNetId: string;
|
controlNetId: string;
|
||||||
processorNode: RequiredDWPoseImageProcessorInvocation;
|
processorNode: RequiredDWOpenposeImageProcessorInvocation;
|
||||||
isEnabled: boolean;
|
isEnabled: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
const DWPoseProcessor = (props: Props) => {
|
const DWOpenposeProcessor = (props: Props) => {
|
||||||
const { controlNetId, processorNode, isEnabled } = props;
|
const { controlNetId, processorNode, isEnabled } = props;
|
||||||
const { image_resolution, draw_body, draw_face, draw_hands } = processorNode;
|
const { image_resolution, draw_body, draw_face, draw_hands } = processorNode;
|
||||||
const processorChanged = useProcessorNodeChanged();
|
const processorChanged = useProcessorNodeChanged();
|
||||||
@ -88,4 +89,4 @@ const DWPoseProcessor = (props: Props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default memo(DWPoseProcessor);
|
export default memo(DWOpenposeProcessor);
|
@ -205,17 +205,17 @@ export const CONTROLNET_PROCESSORS: ControlNetProcessorsDict = {
|
|||||||
image_resolution: 512,
|
image_resolution: 512,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
dwpose_image_processor: {
|
dw_openpose_image_processor: {
|
||||||
type: 'dwpose_image_processor',
|
type: 'dw_openpose_image_processor',
|
||||||
get label() {
|
get label() {
|
||||||
return i18n.t('controlnet.dwPose');
|
return i18n.t('controlnet.dwOpenpose');
|
||||||
},
|
},
|
||||||
get description() {
|
get description() {
|
||||||
return i18n.t('controlnet.dwPoseDescription');
|
return i18n.t('controlnet.dwOpenposeDescription');
|
||||||
},
|
},
|
||||||
default: {
|
default: {
|
||||||
id: 'dwpose_image_processor',
|
id: 'dw_openpose_image_processor',
|
||||||
type: 'dwpose_image_processor',
|
type: 'dw_openpose_image_processor',
|
||||||
image_resolution: 512,
|
image_resolution: 512,
|
||||||
draw_body: true,
|
draw_body: true,
|
||||||
draw_face: false,
|
draw_face: false,
|
||||||
@ -267,7 +267,7 @@ export const CONTROLNET_MODEL_DEFAULT_PROCESSORS: {
|
|||||||
lineart_anime: 'lineart_anime_image_processor',
|
lineart_anime: 'lineart_anime_image_processor',
|
||||||
softedge: 'hed_image_processor',
|
softedge: 'hed_image_processor',
|
||||||
shuffle: 'content_shuffle_image_processor',
|
shuffle: 'content_shuffle_image_processor',
|
||||||
openpose: 'dwpose_image_processor',
|
openpose: 'dw_openpose_image_processor',
|
||||||
mediapipe: 'mediapipe_face_processor',
|
mediapipe: 'mediapipe_face_processor',
|
||||||
pidi: 'pidi_image_processor',
|
pidi: 'pidi_image_processor',
|
||||||
zoe: 'zoe_depth_image_processor',
|
zoe: 'zoe_depth_image_processor',
|
||||||
|
@ -11,7 +11,7 @@ import type {
|
|||||||
ColorMapImageProcessorInvocation,
|
ColorMapImageProcessorInvocation,
|
||||||
ContentShuffleImageProcessorInvocation,
|
ContentShuffleImageProcessorInvocation,
|
||||||
DepthAnythingImageProcessorInvocation,
|
DepthAnythingImageProcessorInvocation,
|
||||||
DWPoseImageProcessorInvocation,
|
DWOpenposeImageProcessorInvocation,
|
||||||
HedImageProcessorInvocation,
|
HedImageProcessorInvocation,
|
||||||
LineartAnimeImageProcessorInvocation,
|
LineartAnimeImageProcessorInvocation,
|
||||||
LineartImageProcessorInvocation,
|
LineartImageProcessorInvocation,
|
||||||
@ -40,7 +40,7 @@ export type ControlAdapterProcessorNode =
|
|||||||
| MidasDepthImageProcessorInvocation
|
| MidasDepthImageProcessorInvocation
|
||||||
| MlsdImageProcessorInvocation
|
| MlsdImageProcessorInvocation
|
||||||
| NormalbaeImageProcessorInvocation
|
| NormalbaeImageProcessorInvocation
|
||||||
| DWPoseImageProcessorInvocation
|
| DWOpenposeImageProcessorInvocation
|
||||||
| PidiImageProcessorInvocation
|
| PidiImageProcessorInvocation
|
||||||
| ZoeDepthImageProcessorInvocation;
|
| ZoeDepthImageProcessorInvocation;
|
||||||
|
|
||||||
@ -143,10 +143,10 @@ export type RequiredNormalbaeImageProcessorInvocation = O.Required<
|
|||||||
>;
|
>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The DWPose processor node, with parameters flagged as required
|
* The DW Openpose processor node, with parameters flagged as required
|
||||||
*/
|
*/
|
||||||
export type RequiredDWPoseImageProcessorInvocation = O.Required<
|
export type RequiredDWOpenposeImageProcessorInvocation = O.Required<
|
||||||
DWPoseImageProcessorInvocation,
|
DWOpenposeImageProcessorInvocation,
|
||||||
'type' | 'image_resolution' | 'draw_body' | 'draw_face' | 'draw_hands'
|
'type' | 'image_resolution' | 'draw_body' | 'draw_face' | 'draw_hands'
|
||||||
>;
|
>;
|
||||||
|
|
||||||
@ -179,7 +179,7 @@ export type RequiredControlAdapterProcessorNode =
|
|||||||
| RequiredMidasDepthImageProcessorInvocation
|
| RequiredMidasDepthImageProcessorInvocation
|
||||||
| RequiredMlsdImageProcessorInvocation
|
| RequiredMlsdImageProcessorInvocation
|
||||||
| RequiredNormalbaeImageProcessorInvocation
|
| RequiredNormalbaeImageProcessorInvocation
|
||||||
| RequiredDWPoseImageProcessorInvocation
|
| RequiredDWOpenposeImageProcessorInvocation
|
||||||
| RequiredPidiImageProcessorInvocation
|
| RequiredPidiImageProcessorInvocation
|
||||||
| RequiredZoeDepthImageProcessorInvocation,
|
| RequiredZoeDepthImageProcessorInvocation,
|
||||||
'id'
|
'id'
|
||||||
@ -299,10 +299,10 @@ export const isNormalbaeImageProcessorInvocation = (obj: unknown): obj is Normal
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type guard for DWPoseImageProcessorInvocation
|
* Type guard for DWOpenposeImageProcessorInvocation
|
||||||
*/
|
*/
|
||||||
export const isDWPoseImageProcessorInvocation = (obj: unknown): obj is DWPoseImageProcessorInvocation => {
|
export const isDWOpenposeImageProcessorInvocation = (obj: unknown): obj is DWOpenposeImageProcessorInvocation => {
|
||||||
if (isObject(obj) && 'type' in obj && obj.type === 'dwpose_image_processor') {
|
if (isObject(obj) && 'type' in obj && obj.type === 'dw_openpose_image_processor') {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
File diff suppressed because one or more lines are too long
@ -156,7 +156,7 @@ export type MediapipeFaceProcessorInvocation = s['MediapipeFaceProcessorInvocati
|
|||||||
export type MidasDepthImageProcessorInvocation = s['MidasDepthImageProcessorInvocation'];
|
export type MidasDepthImageProcessorInvocation = s['MidasDepthImageProcessorInvocation'];
|
||||||
export type MlsdImageProcessorInvocation = s['MlsdImageProcessorInvocation'];
|
export type MlsdImageProcessorInvocation = s['MlsdImageProcessorInvocation'];
|
||||||
export type NormalbaeImageProcessorInvocation = s['NormalbaeImageProcessorInvocation'];
|
export type NormalbaeImageProcessorInvocation = s['NormalbaeImageProcessorInvocation'];
|
||||||
export type DWPoseImageProcessorInvocation = s['DWPoseImageProcessorInvocation'];
|
export type DWOpenposeImageProcessorInvocation = s['DWOpenposeImageProcessorInvocation'];
|
||||||
export type PidiImageProcessorInvocation = s['PidiImageProcessorInvocation'];
|
export type PidiImageProcessorInvocation = s['PidiImageProcessorInvocation'];
|
||||||
export type ZoeDepthImageProcessorInvocation = s['ZoeDepthImageProcessorInvocation'];
|
export type ZoeDepthImageProcessorInvocation = s['ZoeDepthImageProcessorInvocation'];
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user