fix xyz with lora none

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2024-12-21 10:56:24 -05:00
parent 8924e5bc5d
commit c3f02f11e4
4 changed files with 9 additions and 4 deletions
+1
View File
@@ -207,6 +207,7 @@ All-in-all, we're around ~160 commits worth of updates, check changelog for full
- notify on torch install
- detect pipeline fro diffusers folder-style model
- do not recast flux quants
- fix xyz-grid with lora none
## Update for 2024-11-21
+4 -1
View File
@@ -320,11 +320,14 @@ def set_pipeline_args(p, model, prompts: list, negative_prompts: list, prompts_2
clean['negative_prompt'] = len(clean['negative_prompt'])
clean.pop('generator', None)
clean['parser'] = parser
for k, v in clean.items():
for k, v in clean.copy().items():
if isinstance(v, torch.Tensor) or isinstance(v, np.ndarray):
clean[k] = v.shape
if isinstance(v, list) and len(v) > 0 and (isinstance(v[0], torch.Tensor) or isinstance(v[0], np.ndarray)):
clean[k] = [x.shape for x in v]
if not debug_enabled and k.endswith('_embeds'):
del clean[k]
clean['prompt'] = 'embeds'
shared.log.debug(f'Diffuser pipeline: {model.__class__.__name__} task={sd_models.get_diffusers_task(model)} batch={p.iteration + 1}/{p.n_iter}x{p.batch_size} set={clean}')
if p.hdr_clamp or p.hdr_maximize or p.hdr_brightness != 0 or p.hdr_color != 0 or p.hdr_sharpen != 0:
+2 -1
View File
@@ -94,7 +94,8 @@ def create_sampler(name, model):
if hasattr(model, "prior_pipe") and hasattr(model.prior_pipe, "scheduler"):
model.prior_pipe.scheduler = sampler.sampler
model.prior_pipe.scheduler.config.clip_sample = False
shared.log.debug(f'Sampler: sampler="{sampler.name}" class="{model.scheduler.__class__.__name__} config={sampler.config}')
clean_config = {k: v for k, v in sampler.config.items() if v is not None and v is not False}
shared.log.debug(f'Sampler: sampler="{sampler.name}" class="{model.scheduler.__class__.__name__} config={clean_config}')
return sampler.sampler
else:
return None
+2 -2
View File
@@ -198,12 +198,12 @@ def list_lora():
def apply_lora(p, x, xs):
p.all_prompts = None
p.all_negative_prompts = None
if x == 'None':
return
x = os.path.basename(x)
p.prompt = p.prompt + f" <lora:{x}:{shared.opts.extra_networks_default_multiplier}>"
p.all_prompts = None
p.all_negative_prompts = None
shared.log.debug(f'XYZ grid apply LoRA: "{x}"')