Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix missing TI hash #12269

Merged
merged 1 commit into from
Aug 3, 2023
Merged

fix missing TI hash #12269

merged 1 commit into from
Aug 3, 2023

Conversation

w-e-w
Copy link
Collaborator

@w-e-w w-e-w commented Aug 3, 2023

Description

issue #12259

prevent positive prompt TI hash from overriding negative prompt TI hash
as this line of code will be called 2 time

Checklist:

@AUTOMATIC1111
Copy link
Owner

it's a very good catch but it the way it is written now will add an extra comma at the beginning

@w-e-w w-e-w marked this pull request as draft August 3, 2023 09:14
@w-e-w
Copy link
Collaborator Author

w-e-w commented Aug 3, 2023

it's a very good catch but it the way it is written now will add an extra comma at the beginning

well actually you're right about it being bugged but it doesn't do that
instead it's missing a , in between

test script

# old
d = {}
hashes = ['1-1', '1-2']
d["TI hashes"] = d.get("TI hashes", "") + ", ".join(hashes)
hashes = ['2-1', '2-2']
d["TI hashes"] = d.get("TI hashes", "") + ", ".join(hashes)
print(d["TI hashes"])
# 1-1, 1-22-1, 2-2
#        ^^

# new
d = {}
hashes = ['1-1', '1-2']
if d.get("TI hashes"):
    hashes.append(d.get("TI hashes"))
d["TI hashes"] = ", ".join(hashes)

hashes = ['2-1', '2-2']
if d.get("TI hashes"):
    hashes.append(d.get("TI hashes"))
d["TI hashes"] = ", ".join(hashes)
print(d["TI hashes"])
# 2-1, 2-2, 1-1, 1-2
# fixed

@w-e-w w-e-w marked this pull request as ready for review August 3, 2023 09:53
@AUTOMATIC1111 AUTOMATIC1111 merged commit 8e840e1 into dev Aug 3, 2023
@w-e-w w-e-w deleted the TI-Hash-fix branch August 3, 2023 09:57
@w-e-w w-e-w mentioned this pull request Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants