Skip to content

Conversation

@hay
Copy link

@hay hay commented Sep 28, 2022

Right now the default output filename is just output.png. This leads to two things that i think are undesirable:

  1. Whenever you run the script again and you didn't give a custom filename the old file will be overwritten
  2. It's impossible to retrieve the original prompt from the file

I've changed the default output filename to be a combination of a timestamp and a (sanitized) version of the prompt. So for example, when running the command:

python text2image.py --prompt="An astronaut riding a horse"

You'll now get the filename:

2022-09-28T22.53.20 - An astronaut riding a horse.png

Instead of just output.png. Of course you can still specify your own filename using the --output option.

@ju-popov
Copy link

ju-popov commented Sep 28, 2022

the problem that i had with such approach is that you easily pass 255 symbols maximum fullpath length :/ So I trim to only first 100 symbols

@hay
Copy link
Author

hay commented Sep 29, 2022

@ju-popov good point. I've changed the PR to trim the 'prompt slug' to a maximum of 100 characters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants