Skip to content

Commit

Permalink
fix: Only apply the index to the specified field
Browse files Browse the repository at this point in the history
fix for this pr AUTOMATIC1111#15460

Only apply the index to the specified field to avoid causing other plugins to fail to save list values.
  • Loading branch information
bluelovers committed Jun 27, 2024
1 parent a30b19d commit 412afd2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,9 +799,11 @@ def create_infotext(p, all_prompts, all_seeds, all_subseeds, comments=None, iter
"User": p.user if opts.add_user_name_to_info else None,
}

# Only apply the index to the specified field to avoid causing other plugins to fail to save list values.
list_index_fields = ["Hires prompt", "Hires negative prompt", "Styles array"]
for key, value in generation_params.items():
try:
if isinstance(value, list):
if key in list_index_fields and isinstance(value, list):
generation_params[key] = value[index]
elif callable(value):
generation_params[key] = value(**locals())
Expand Down

0 comments on commit 412afd2

Please sign in to comment.