Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Longer integrated [prompt] character limit for saving filenames (not referring to token length) #1769

Closed
tytekkit opened this issue Oct 6, 2022 · 5 comments
Labels
question Further information is requested

Comments

@tytekkit
Copy link

tytekkit commented Oct 6, 2022

When I save files, image-to-text, I've noticed the prompt portion cuts off at 128 characters.

I'd like to be able to make the character length it saves file names for the [prompt] portion as unlimited or a much higher number (besides Windows filename truncation). Even if my prompt falls well below the maximum 75-77 tokens, filenames are not saved with the full length of characters.

Describe alternatives you've considered
An alternative is checking "Create a text file next to every image with generation parameters." This alternative is too messy for me personally or time consuming to copy the text inside and replace each file name.

I tried looking for where the length for this parameter is cut in the files to adjust it, even running scripts to find the number 128 within files (too many results). If anyone knows where this limit can be changed, lmk.

Example:

before: [https://puu.sh/Jomua/b6d1a38767.png]
"purple haired cyberpunk android woman with detailed black and red metal suit, purple face, bold outlines, metroid dread, greg rutkowski"

after saving: [https://puu.sh/Jomuo/01a674dca7.png]
"00006-purple haired cyberpunk android woman with detailed black and red metal suit, purple face, bold outlines, metroid dread, greg r,3460742202" -- cuts off at "greg r", with the Image Filename Pattern "[prompt_spaces],[seed]". Issue also replicated with default pattern.

Thank you for any info supplied.

@dfaker
Copy link
Collaborator

dfaker commented Oct 6, 2022

You can edit this line in your local copy:

max_filename_part_length = 128

Gotta ask yourself when filenames stop being useful as a data storage mechanism though.

@dfaker dfaker added the question Further information is requested label Oct 6, 2022
@dfaker dfaker closed this as completed Oct 6, 2022
@tytekkit
Copy link
Author

tytekkit commented Oct 6, 2022

Gotta ask yourself when filenames stop being useful as a data storage mechanism though.

I'm just generating idea-boards, nothing robust. If the scope grows out of hand, I'll use a python script to parse the filenames into columns in a spreadsheet for prompts and seeds.

This works for me, Thanks! 💯

@feffy380
Copy link

feffy380 commented Oct 8, 2022

Do note that common filesystems only support up to 255 characters

@tytekkit
Copy link
Author

tytekkit commented Oct 9, 2022

Do note that common filesystems only support up to 255 characters

Thank you. But I'm aware, quoting myself "besides Windows filename truncation." I think AI isn't quite there for that length of specificity to be useful or accurate. But above 125 characters, yes it seems to adhere to that level of accuracy with certain prompts.

ryankashi pushed a commit to ryankashi/kashi-stable-diffusion-webui that referenced this issue Jul 23, 2023
Loader.js fix () changed blending method and added preload, fixed logo too
@bwesen
Copy link

bwesen commented Jul 27, 2023

In case anyone else comes here looking for why the auto1111 filenames sometimes truncate the prompt despite this character limit being much higher, the reason is that there is a setting under "Saving to a directory" with a slider with a maximum number of words to expand into [prompt_words] like I used, which defaults to 8.

nne998 pushed a commit to fjteam/stable-diffusion-webui that referenced this issue Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants