Since otherwise, with a crazy-long prompt, we could exceed the limit
of the filesystem, (which I think is 255 characters for what I'm using
for the server currently). In this commit, we don't use more than 200
characters from the prompt itself, to which we could add 10 from the
seed and another handful for separators and a file extension, so that
should be good.
counter = 1
seed = artifact.seed
while True:
counter = 1
seed = artifact.seed
while True:
+ prompt_abbrev = prompt[:200]
- base = "{}_{}_{}.png".format(seed, prompt, counter)
+ base = "{}_{}_{}.png".format(seed, prompt_abbrev, counter)
- 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):
base = normalize_filename(base)
filename = "{}{}/{}".format(DOCUMENT_ROOT, IMAGES_PATH, base)
if not os.path.exists(filename):