mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
validate and fix all refiner workflows
This commit is contained in:
+11
-7
@@ -49,17 +49,21 @@
|
||||
- **Internal**
|
||||
- remove obsolete textual inversion training code
|
||||
- remove obsolete hypernetworks training code
|
||||
- **Refiner** validated workflows:
|
||||
- Fully functional: SD15 + SD15, SDXL + SDXL, SDXL + SDXL-R
|
||||
- Functional, but result is not as good: SD15 + SDXL, SDXL + SD15, SD15 + SDXL-R
|
||||
- **Fixes**
|
||||
- improve model cpu offload compatibility
|
||||
- improve model sequential offload compatibility
|
||||
- improve bfloat16 compatibility
|
||||
- improve xformers installer to match cuda version and install triton
|
||||
- improve *model cpu offload* compatibility
|
||||
- improve *model sequential offload* compatibility
|
||||
- improve *bfloat16* compatibility
|
||||
- improve *xformers* installer to match cuda version and install triton
|
||||
- fix extra networks refresh
|
||||
- fix sdp memory attention in backend original
|
||||
- fix *sdp memory attention* in backend original
|
||||
- fix autodetect sd21 models
|
||||
- fix api info endpoint
|
||||
- fix sampler eta in xyz grid, thanks @AI-Casanova
|
||||
- use diffusers lora load override for lcm/tcd/turbo loras
|
||||
- fix *sampler eta* in xyz grid, thanks @AI-Casanova
|
||||
- fix *requires_aesthetics_score* errors
|
||||
- use diffusers lora load override for *lcm/tcd/turbo loras*
|
||||
- exception handler around vram memory stats gather
|
||||
- improve ZLUDA installer with `--use-zluda` cli param, thanks @lshqqytiger
|
||||
|
||||
|
||||
@@ -561,8 +561,8 @@ def process_diffusers(p: processing.StableDiffusionProcessing):
|
||||
)
|
||||
shared.state.sampling_steps = refiner_args['num_inference_steps']
|
||||
try:
|
||||
if 'requires_aesthetics_score' in shared.sd_refiner.config:
|
||||
shared.sd_refiner.register_to_config(requires_aesthetics_score=shared.opts.diffusers_aesthetics_score)
|
||||
if 'requires_aesthetics_score' in shared.sd_refiner.config: # sdxl-model needs false and sdxl-refiner needs true
|
||||
shared.sd_refiner.register_to_config(requires_aesthetics_score = getattr(shared.sd_refiner, 'tokenizer', None) is None)
|
||||
refiner_output = shared.sd_refiner(**refiner_args) # pylint: disable=not-callable
|
||||
if isinstance(refiner_output, dict):
|
||||
refiner_output = SimpleNamespace(**refiner_output)
|
||||
|
||||
@@ -151,13 +151,11 @@ def prepare_embedding_providers(pipe, clip_skip):
|
||||
embedding_type = -(clip_skip + 1)
|
||||
else:
|
||||
embedding_type = clip_skip
|
||||
if hasattr(pipe, "tokenizer") and hasattr(pipe, "text_encoder"):
|
||||
provider = EmbeddingsProvider(tokenizer=pipe.tokenizer, text_encoder=pipe.text_encoder, truncate=False,
|
||||
returned_embeddings_type=embedding_type, device=device)
|
||||
if getattr(pipe, "tokenizer", None) is not None and getattr(pipe, "text_encoder", None) is not None:
|
||||
provider = EmbeddingsProvider(tokenizer=pipe.tokenizer, text_encoder=pipe.text_encoder, truncate=False, returned_embeddings_type=embedding_type, device=device)
|
||||
embeddings_providers.append(provider)
|
||||
if hasattr(pipe, "tokenizer_2") and hasattr(pipe, "text_encoder_2"):
|
||||
provider = EmbeddingsProvider(tokenizer=pipe.tokenizer_2, text_encoder=pipe.text_encoder_2, truncate=False,
|
||||
returned_embeddings_type=embedding_type, device=device)
|
||||
if getattr(pipe, "tokenizer_2", None) is not None and getattr(pipe, "text_encoder_2", None) is not None:
|
||||
provider = EmbeddingsProvider(tokenizer=pipe.tokenizer_2, text_encoder=pipe.text_encoder_2, truncate=False, returned_embeddings_type=embedding_type, device=device)
|
||||
embeddings_providers.append(provider)
|
||||
return embeddings_providers
|
||||
|
||||
|
||||
@@ -998,9 +998,6 @@ def load_diffuser(checkpoint_info=None, already_loaded_state_dict=None, timer=No
|
||||
if model_type.startswith('Stable Diffusion'):
|
||||
if shared.opts.diffusers_force_zeros:
|
||||
diffusers_load_config['force_zeros_for_empty_prompt '] = shared.opts.diffusers_force_zeros
|
||||
if shared.opts.diffusers_aesthetics_score:
|
||||
diffusers_load_config['requires_aesthetics_score'] = shared.opts.diffusers_aesthetics_score
|
||||
# diffusers_load_config['config_files'] = get_load_config(checkpoint_info.path.lower())
|
||||
diffusers_load_config['original_config_file'] = get_load_config(checkpoint_info.path, model_type)
|
||||
if hasattr(pipeline, 'from_single_file'):
|
||||
diffusers_load_config['use_safetensors'] = True
|
||||
@@ -1263,7 +1260,7 @@ def set_diffuser_pipe(pipe, new_pipe_type):
|
||||
new_pipe.is_sdxl = getattr(pipe, 'is_sdxl', False) # a1111 compatibility item
|
||||
new_pipe.is_sd2 = getattr(pipe, 'is_sd2', False)
|
||||
new_pipe.is_sd1 = getattr(pipe, 'is_sd1', True)
|
||||
shared.log.debug(f"Pipeline class change: original={pipe.__class__.__name__} target={new_pipe.__class__.__name__} fn={sys._getframe().f_back.f_code.co_name}")
|
||||
shared.log.debug(f"Pipeline class change: original={pipe.__class__.__name__} target={new_pipe.__class__.__name__} fn={sys._getframe().f_back.f_code.co_name}") # pylint: disable=protected-access
|
||||
pipe = new_pipe
|
||||
return pipe
|
||||
|
||||
|
||||
@@ -458,7 +458,6 @@ options_templates.update(options_section(('diffusers', "Diffusers Settings"), {
|
||||
"diffusers_to_gpu": OptionInfo(False, "Load model directly to GPU"),
|
||||
"disable_accelerate": OptionInfo(False, "Disable accelerate"),
|
||||
"diffusers_force_zeros": OptionInfo(False, "Force zeros for prompts when empty", gr.Checkbox, {"visible": False}),
|
||||
"diffusers_aesthetics_score": OptionInfo(False, "Require aesthetics score"),
|
||||
"diffusers_pooled": OptionInfo("default", "Diffusers SDXL pooled embeds", gr.Radio, {"choices": ['default', 'weighted']}),
|
||||
"huggingface_token": OptionInfo('', 'HuggingFace token'),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user