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

Add Filename Character Limit #19

Merged
merged 2 commits into from
Dec 15, 2022
Merged

Add Filename Character Limit #19

merged 2 commits into from
Dec 15, 2022

Conversation

dec2-anon
Copy link
Contributor

Very long prompts cause the error:

Error: saving("Failed to create destination for file:///path/prompt.seed.final.png"

Very long prompts cause this error:

Error: saving("Failed to create destination for file:///path/prompt.seed.final.png"
@dec2-anon
Copy link
Contributor Author

Actually might want to change fileCharLimit to a let since it never mutated

@gretel
Copy link

gretel commented Dec 6, 2022

change fixes too long of a filename issue for me. thanks!

Co-authored-by: Stefan-Hintz <[email protected]>
@msiracusa
Copy link
Collaborator

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

@dec2-anon
Copy link
Contributor Author

  • I agree to the terms outlined in CONTRIBUTING.md

@msiracusa msiracusa self-requested a review December 15, 2022 15:13
Copy link
Collaborator

@msiracusa msiracusa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@philipturner
Copy link

@msiracusa as mentioned in #53, please revert this contribution. It incorrectly conflates 75 characters with 75 words. This means users will now have their images overwritten if they change a reasonably complex prompt (e.g. 300 characters and 74 words) by changing the last word.

@philipturner
Copy link

My solution factored in not only the file name, but the total path name length. It also allows more varied length in file name and even warns you when it’s going to overwrite a file you didn’t want.

@dec2-anon
Copy link
Contributor Author

You're right, this is more of a bandaid fix. But #53 seems to do a lot more than just add a path character limit. Don't know if a separate metadata file is a good idea. It would get messy with lots of generations

If they decide to merge #53 then I suggest we add the metadata description containing the prompt directly to the generated image.

@dec2-anon
Copy link
Contributor Author

@philipturner Followup: I was tinkering with NSAppleScript and I got it to add the metadata details into the kMDItemFinderComment attribute

Screenshot 2022-12-17 at 1 14 12 PM

@dec2-anon
Copy link
Contributor Author

I'll create another PR later today when I rewrite it in native swift code without AppleScript

takeyat pushed a commit to takeyat/ml-stable-diffusion that referenced this pull request Dec 25, 2022
* commit 'e07c4d00c387840f70fa3701fb3a51c2a32f37b8':
  Move guidanceScale as generation parameter (apple#46)
  Add brief instructions to download weights from the Hub (apple#10)
  Adds Negative Prompts (apple#61)
  Changed seed type into UInt32 (apple#47)
  fixes apple#77
  Update README.md (apple#66)
  Add Filename Character Limit (apple#19)
  Implement DPM-Solver++ scheduler (apple#59)
  Fix typos: Successfully facilitate getting pipeline overridden (apple#30)
  Undefined name: from typing import List (apple#31)
  Add Availability Annotations (apple#18)
  README improvements and reduceMemory option in Swift
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.

5 participants