Skip to content

Commit

Permalink
Merge pull request #15263 from AUTOMATIC1111/fix-hr-comments
Browse files Browse the repository at this point in the history
Strip comments from hires fix prompt
  • Loading branch information
AUTOMATIC1111 authored Mar 16, 2024
2 parents c5aa7b6 + 5f4203b commit 3ffe47c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions modules/processing_scripts/comments.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ def process(self, p, *args):
p.main_prompt = strip_comments(p.main_prompt)
p.main_negative_prompt = strip_comments(p.main_negative_prompt)

if getattr(p, 'enable_hr', False):
p.all_hr_prompts = [strip_comments(x) for x in p.all_hr_prompts]
p.all_hr_negative_prompts = [strip_comments(x) for x in p.all_hr_negative_prompts]

p.hr_prompt = strip_comments(p.hr_prompt)
p.hr_negative_prompt = strip_comments(p.hr_negative_prompt)


def before_token_counter(params: script_callbacks.BeforeTokenCounterParams):
if not shared.opts.enable_prompt_comments:
Expand Down

0 comments on commit 3ffe47c

Please sign in to comment.