optimize: import pipeline ondemand
fix: force cpu device for `tensor_paste` - prevent device mismatch error
This commit is contained in:
@@ -2,7 +2,7 @@ import configparser
|
||||
import os
|
||||
|
||||
|
||||
version = "V4.48.3"
|
||||
version = "V4.48.4"
|
||||
|
||||
dependency_version = 19
|
||||
|
||||
|
||||
@@ -15,12 +15,13 @@ import comfy
|
||||
import impact.wildcards as wildcards
|
||||
import math
|
||||
import cv2
|
||||
import time
|
||||
|
||||
SEG = namedtuple("SEG",
|
||||
['cropped_image', 'cropped_mask', 'confidence', 'crop_region', 'bbox', 'label', 'control_net_wrapper'],
|
||||
defaults=[None])
|
||||
|
||||
pb_id_cnt = 0
|
||||
pb_id_cnt = time.time()
|
||||
preview_bridge_image_id_map = {}
|
||||
preview_bridge_image_name_map = {}
|
||||
preview_bridge_cache = {}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
from transformers import pipeline
|
||||
import comfy
|
||||
import re
|
||||
from impact.utils import *
|
||||
@@ -31,6 +30,8 @@ class HF_TransformersClassifierProvider:
|
||||
CATEGORY = "ImpactPack/HuggingFace"
|
||||
|
||||
def doit(self, preset_repo_id, manual_repo_id, device_mode):
|
||||
from transformers import pipeline
|
||||
|
||||
if preset_repo_id == 'Manual repo id':
|
||||
url = manual_repo_id
|
||||
else:
|
||||
|
||||
@@ -237,6 +237,8 @@ class DetailerForEach:
|
||||
if not (enhanced_image is None):
|
||||
# don't latent composite-> converting to latent caused poor quality
|
||||
# use image paste
|
||||
image = image.cpu()
|
||||
enhanced_image = enhanced_image.cpu()
|
||||
tensor_paste(image, enhanced_image, (seg.crop_region[0], seg.crop_region[1]), mask)
|
||||
enhanced_list.append(enhanced_image)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user