BiRefNetUltraV2 node support cuda and cpu device

This commit is contained in:
chflame163
2024-09-05 16:05:11 +08:00
parent 7d226d4f22
commit acb2d54be8
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -1,3 +1,4 @@
import os
import sys
import torch
from torchvision import transforms
@@ -91,7 +92,7 @@ class LS_BiRefNetUltraV2:
local_files_only = False
torch.set_float32_matmul_precision(['high', 'highest'][0])
birefnet_model.to('cuda')
birefnet_model.to(device)
birefnet_model.eval()
@@ -105,7 +106,7 @@ class LS_BiRefNetUltraV2:
transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
])
inference_image = transform_image(orig_image).unsqueeze(0).to('cuda')
inference_image = transform_image(orig_image).unsqueeze(0).to(device)
# Prediction
with torch.no_grad():
+1 -1
View File
@@ -1,7 +1,7 @@
[project]
name = "comfyui_layerstyle"
description = "A set of nodes for ComfyUI it generate image like Adobe Photoshop's Layer Style. the Drop Shadow is first completed node, and follow-up work is in progress."
version = "1.0.46"
version = "1.0.47"
license = "MIT"
dependencies = ["numpy", "pillow", "torch", "matplotlib", "Scipy", "scikit_image", "opencv-contrib-python", "pymatting", "segment_anything", "timm", "addict", "yapf", "colour-science", "wget", "mediapipe", "loguru", "typer_config", "fastapi", "rich", "google-generativeai", "diffusers", "omegaconf", "tqdm", "transformers", "kornia", "image-reward", "ultralytics", "blend_modes", "blind-watermark", "qrcode", "pyzbar", "transparent-background", "huggingface_hub", "accelerate", "bitsandbytes", "torchscale", "wandb", "hydra-core", "psd-tools", "inference-cli[yolo-world]", "inference-gpu[yolo-world]", "onnxruntime"]