Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/fix-emb' into master4
Browse files Browse the repository at this point in the history
  • Loading branch information
gesen2egee committed Apr 15, 2024
2 parents 0bdb1da + 8119150 commit 47979d1
Show file tree
Hide file tree
Showing 3 changed files with 229 additions and 52 deletions.
9 changes: 5 additions & 4 deletions library/train_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -5639,10 +5639,11 @@ def sample_image_inference(
prompt: str = prompt_dict.get("prompt", "")
sampler_name: str = prompt_dict.get("sample_sampler", args.sample_sampler)

if prompt_replacement is not None:
prompt = prompt.replace(prompt_replacement[0], prompt_replacement[1])
if negative_prompt is not None:
negative_prompt = negative_prompt.replace(prompt_replacement[0], prompt_replacement[1])
if len(prompt_replacement) > 0:
for to_replace, replaced_by in prompt_replacement:
prompt = prompt.replace(to_replace, replaced_by)
if negative_prompt is not None:
negative_prompt = negative_prompt.replace(to_replace, replaced_by)

if seed is not None:
torch.manual_seed(seed)
Expand Down
Loading

0 comments on commit 47979d1

Please sign in to comment.