simplify ti loading

This commit is contained in:
Vladimir Mandic
2023-09-16 13:46:22 -04:00
parent 4e209fe87f
commit 3c3b3b9291
6 changed files with 11 additions and 21 deletions
+3 -6
View File
@@ -3,6 +3,7 @@ import inspect
import typing
import torch
import torchvision.transforms.functional as TF
import diffusers
import modules.devices as devices
import modules.shared as shared
import modules.sd_samplers as sd_samplers
@@ -15,12 +16,6 @@ from modules.processing import StableDiffusionProcessing
import modules.prompt_parser_diffusers as prompt_parser_diffusers
try:
import diffusers
except Exception as ex:
shared.log.error(f'Failed to import diffusers: {ex}')
def process_diffusers(p: StableDiffusionProcessing, seeds, prompts, negative_prompts):
results = []
if p.enable_hr and p.hr_upscaler != 'None' and p.denoising_strength > 0 and len(getattr(p, 'init_images', [])) == 0:
@@ -171,6 +166,8 @@ def process_diffusers(p: StableDiffusionProcessing, seeds, prompts, negative_pro
return prompts, negative_prompts, prompts_2, negative_prompts_2
def set_pipeline_args(model, prompts: list, negative_prompts: list, prompts_2: typing.Optional[list]=None, negative_prompts_2: typing.Optional[list]=None, desc:str='', **kwargs):
if hasattr(model, 'embedding_db'):
del model.embedding_db
try:
is_refiner = model.text_encoder.__class__.__name__ != 'CLIPTextModel'
except Exception: