mirror of
https://github.com/vladmandic/automatic
synced 2026-09-18 00:34:33 +02:00
simplify ti loading
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user