Skip to content

Commit

Permalink
infotext parse force params delimiter
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimir Mandic <[email protected]>
  • Loading branch information
vladmandic committed Feb 23, 2025
1 parent 8a997f3 commit 881b283
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- zluda hotfixes
- zluda force sync
- fix torch import on compile
- infotext parser force delimiter before params

## Update for 2025-02-18

Expand Down
5 changes: 4 additions & 1 deletion modules/infotext.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ def parse(infotext):
debug(f'Raw: {infotext}')

remaining = infotext.replace('\nSteps:', ' Steps:')
params = ['steps:', 'seed:', 'width:', 'height:', 'sampler:', 'size:', 'cfg scale:'] # first param is one of those
# TODO infotext: handle using regex instead
params = [' steps:', ' seed:', ' width:', ' height:', ' sampler:', ' size:', ' cfg scale:'] # first param is one of those
params += ['\nsteps:', '\nseed:', '\nwidth:', '\nheight:', '\nsampler:', '\nsize:', '\ncfg scale:']
params += ['.steps:', '.seed:', '.width:', '.height:', '.sampler:', '.size:', '.cfg scale:']

prompt_end = [remaining.lower().find(p) for p in params if p in remaining.lower()]
prompt_end += [remaining.lower().find('negative prompt:')]
Expand Down

0 comments on commit 881b283

Please sign in to comment.