For now, changing DWPose preprocessor to alway use 'cpu' device.

This commit is contained in:
user1 2023-09-27 18:06:22 -07:00
parent e625c44c73
commit 44a80a4929

View File

@ -127,7 +127,7 @@ class ControlNetInvocation(BaseInvocation):
@invocation(
"image_processor", title="Base Image Processor", tags=["controlnet"], category="controlnet", version="1.0.0"
"image_processor", title="Base Image Processorwp", tags=["controlnet"], category="controlnet", version="1.0.0"
)
class ImageProcessorInvocation(BaseInvocation):
"""Base class for invocations that preprocess images for ControlNet"""
@ -607,7 +607,9 @@ class DWPoseImageProcessorInvocation(ImageProcessorInvocation):
image_resolution: int = InputField(default=512, ge=0, description=FieldDescriptions.image_res)
def run_processor(self, image):
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
# device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
# for now, executing DWPose processing on CPU only
device = "cpu"
dwpose_processor = DWposeDetector(device=device)
processed_image = dwpose_processor(
image,