dev
d8ahazard 2024-03-06 10:58:27 -06:00
parent b58a14d231
commit 3eaa908086
4 changed files with 6 additions and 6 deletions

View File

@ -48,7 +48,7 @@ class BLIPInterrogator(Interrogator):
try:
model_path = fetch_model('Salesforce/blip2-opt-6.7b', "blip2")
self.processor = AutoProcessor.from_pretrained(model_path)
self.model = Blip2ForConditionalGeneration.from_pretrained(model_path, torch_dtype=torch.float16, load_in_8bit=True)
self.model = Blip2ForConditionalGeneration.from_pretrained(model_path, torch_dtype=torch.float16, load_in_8bit=False)
self.device = "cuda" if torch.cuda.is_available() else "cpu"
self.model.to(self.device)
except:

View File

@ -43,7 +43,7 @@ Avoid adding new information not supported by the existing caption or the image.
class LLAVA2Interrogator(Interrogator):
model = None
processor = None
params = {"max_tokens": 75, "load_mplug_8bit": True}
params = {"max_tokens": 75, "load_mplug_8bit": False}
def __init__(self, params: ProcessParams):
super().__init__(params)

View File

@ -25,7 +25,7 @@ class ProcessParams:
dst: str = ""
face_model: str = "Codeformers"
flip: bool = False
load_mplug_8bit: bool = True
load_mplug_8bit: bool = False
max_clip_tokens: float = 1.0
max_size: int = 1024
max_tokens: int = 75

View File

@ -561,7 +561,6 @@ def process_post(files: ImageData, params: ProcessParams) -> List[ImageData]:
if params.upscale:
total_post += total_files
pbar = tqdm(total=total_post, desc="Post-processing images")
params.do_rename = False
upscalers = []
if params.upscale:
@ -570,7 +569,7 @@ def process_post(files: ImageData, params: ProcessParams) -> List[ImageData]:
upscalers.append(params.upscaler_1)
if params.upscaler_2 is not None and params.upscaler_2 != "None":
upscalers.append(params.upscaler_2)
img_index = 0
for file in files:
img = file.get_image()
if params.restore_faces:
@ -637,10 +636,11 @@ def process_post(files: ImageData, params: ProcessParams) -> List[ImageData]:
shared.state.current_image = img
if params.save_image:
img_path = save_pic(img, file, 0, params)
img_path = save_pic(img, file, img_index, params)
file.image_path = img_path
file.update_image(img, False)
output.append(file)
img_index += 1
return output