Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions scripts/txt2img.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@ def main():
default="a painting of a virus monster playing guitar",
help="the prompt to render"
)
parser.add_argument(
"--negative_prompt",
type=str,
nargs="?",
default="",
help="the negative prompt to render"
)
parser.add_argument(
"--outdir",
type=str,
Expand Down Expand Up @@ -286,8 +293,9 @@ def main():
for n in trange(opt.n_iter, desc="Sampling"):
for prompts in tqdm(data, desc="data"):
uc = None
if opt.scale != 1.0:
uc = model.get_learned_conditioning(batch_size * [""])
if len(opt.negative_prompt) > 1:
uc = model.get_learned_conditioning(
len(prompts) * [opt.negative_prompt])
if isinstance(prompts, tuple):
prompts = list(prompts)
c = model.get_learned_conditioning(prompts)
Expand Down