image metadata handle correct image index

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2026-08-14 10:44:56 +02:00
parent 0ac89385a0
commit ce69dd4f17
4 changed files with 13 additions and 4 deletions
+1
View File
@@ -44,6 +44,7 @@
- cleanup alt offload codepaths
- hf progress bars
- processing stats reporting
- image metadata handle correct image index
## Update for 2026-08-07
+8 -1
View File
@@ -23,6 +23,7 @@ def create_infotext(p: StableDiffusionProcessing, all_prompts=None, all_seeds=No
if not hasattr(shared.sd_model, 'sd_checkpoint_info'):
return ''
job_size = p.n_iter * p.batch_size
if index is None:
index = position_in_batch + iteration * p.batch_size
if all_prompts is None:
@@ -209,7 +210,13 @@ def create_infotext(p: StableDiffusionProcessing, all_prompts=None, all_seeds=No
if shared.sd_model_type == 'h1':
args['LLM'] = None if shared.opts.model_h1_llama_repo == 'Default' else shared.opts.model_h1_llama_repo
args.update(p.extra_generation_params)
# args.update(p.extra_generation_params)
for k, v in p.extra_generation_params.items():
if isinstance(v, (list, tuple)) and (job_size > index) and (len(v) > 1) and (len(v) == job_size): # likely a per-job param
args[k] = v[index]
else:
args[k] = v
for k, v in args.copy().items():
if v is None:
del args[k]
+1 -1
View File
@@ -60,7 +60,7 @@ def get_default_modes(cmd_opts, mem_stat):
default_sdp_override_options = ['Dynamic attention']
if devices.get_optimal_device_name() != "cpu":
os.environ.setdefault('SDNQ_USE_OPENVINO_MM', '0')
os.environ.setdefault('SDNQ_USE_OPENVINO_MM', '0') # TODO sdnq openvino: this is too late as sdnq already initialized it
return (
default_offload_mode,
+3 -2
View File
@@ -123,6 +123,7 @@ def apply_file_wildcards(prompt, replaced = None, not_found = None, recursion=0,
not_found = []
if replaced is None:
replaced = []
def check_wildcard_files(prompt, wildcard, files, file_only=True):
trimmed = wildcard.replace('\\', os.path.sep).replace('/', os.path.sep).strip().lower()
for file in files:
@@ -144,8 +145,6 @@ def apply_file_wildcards(prompt, replaced = None, not_found = None, recursion=0,
prompt = prompt.replace(f"__{wildcard}__", choice, 1)
log.debug(f'Apply wildcard: select="{wildcard}" choice="{choice}" file="{file}" choices={len(lines)}')
replaced.append(wildcard)
if p is not None:
p.extra_generation_params['Wildcards'] = p.extra_generation_params.get('Wildcards', []) + [trimmed]
return prompt, True
except Exception as e:
log.error(f'Wildcards: wildcard={wildcard} file={file} {e}')
@@ -206,6 +205,8 @@ def apply_wildcards_to_prompt(prompt, all_wildcards, seed=-1, silent=False, p: S
log.debug(f'Apply wildcards: {replaced} path="{shared.opts.wildcards_dir}" type=style time={t1-t0:.2f}')
if (len(replaced_file) > 0 or len(not_found) > 0) and not silent:
log.debug(f'Apply wildcards: found={replaced_file} missing={not_found} path="{shared.opts.wildcards_dir}" type=file seed={seed} time={t2-t2:.2f}')
if p is not None:
p.extra_generation_params['Wildcards'] = p.extra_generation_params.get('Wildcards', []) + [replaced_file]
if old_state is not None:
random.setstate(old_state)
return prompt