counter = 1
seed = artifact.seed
while True:
+ prompt_abbrev = prompt[:200]
if counter > 1:
- base = "{}_{}_{}.png".format(seed, prompt, counter)
+ base = "{}_{}_{}.png".format(seed, prompt_abbrev, counter)
else:
- base = "{}_{}.png".format(seed, prompt)
+ base = "{}_{}.png".format(seed, prompt_abbrev)
base = normalize_filename(base)
filename = "{}{}/{}".format(DOCUMENT_ROOT, IMAGES_PATH, base)
if not os.path.exists(filename):
stability_api = client.StabilityInference(
key=os.environ['STABILITY_KEY'],
verbose=True,
- engine="stable-diffusion-512-v2-0"
+ engine="stable-diffusion-768-v2-1"
)
prompt_string = " ".join(args.prompt)
if args.seed:
- answers = stability_api.generate(seed=args.seed, prompt=prompt_string)
+ answers = stability_api.generate(width=768, height=768,
+ seed=args.seed, prompt=prompt_string)
else:
- answers = stability_api.generate(prompt=prompt_string)
+ answers = stability_api.generate(width=768, height=768,
+ prompt=prompt_string)
results = []
for resp in answers: