ml-stable-diffusion icon indicating copy to clipboard operation
ml-stable-diffusion copied to clipboard

fix: File name too long when prompt too long (#52)

Open soulteary opened this issue 3 years ago • 7 comments

issue: https://github.com/apple/ml-stable-diffusion/issues/52

soulteary avatar Dec 09 '22 21:12 soulteary

I also patched up the error on the Swift side. Would you mind merging my commit into this PR?

philipturner avatar Dec 10 '22 06:12 philipturner

@philipturner done, now we patched both swift and python 🍻

soulteary avatar Dec 10 '22 11:12 soulteary

Thank you for your interest in contributing to Core ML Stable Diffusion! Please review CONTRIBUTING.md. If you would like to proceed with this pull request, please indicate your agreement to the terms outlined in CONTRIBUTING.md by checking the box below.

We appreciate your interest in the project!

  • [ ] I agree to the terms outlined in CONTRIBUTING.md

atiorh avatar Dec 16 '22 02:12 atiorh

#19 has been merged, so looks like I need to rollback your changes first @philipturner :)

soulteary avatar Dec 16 '22 03:12 soulteary

  • [x] I agree to the terms outlined in CONTRIBUTING.md

@atiorh

soulteary avatar Dec 16 '22 03:12 soulteary

There’s still the issue of when your folder structure is 200 characters long and the file is 75 characters. Then the complete path exceeds 255 characters and causes a runtime crash. Also have you looked at how Auto 1111’s WebUI permits prompts that are integer multiples of 75? I think limiting the file name to 75 characters is fixing a symptom, not the problem.

Furthermore, the maximum prompt size is 75 tokens, not 75 characters. @atiorh I request that you review and/or revert any commits conflating 75 characters with 75 comma-separated phrases.

philipturner avatar Dec 16 '22 06:12 philipturner

What about taking the hash of the prompt?

Drblessing avatar Jan 27 '23 20:01 Drblessing