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

Improve prompting for diffusers default snippets #909

Merged
merged 14 commits into from
Sep 19, 2024

Conversation

apolinario
Copy link
Contributor

Addressing comments left on #907, specially for LoRAs

Addressing comments left on #907, specially for LoRAs
@mishig25
Copy link
Collaborator

mishig25 commented Sep 18, 2024

looking great!

regarding this line:

prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersDefaultPrompt}"

I think there can be edge case where user supplied prompt has quote like ", which means we need to escape ".
Otherwise, there is a danger of producing broken python code like:

prompt = "Astronaut holding sign that says "Hello"" # which is that it is now

prompt = "Astronaut holding sign that says \"Hello\"" # which is what it should be

@apolinario apolinario marked this pull request as ready for review September 18, 2024 10:27
Copy link
Member

@Vaibhavs10 Vaibhavs10 left a comment

Choose a reason for hiding this comment

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

Conceptually looks great to me! Thanks for taking this to the finish line! 🐐

@mishig25 mishig25 merged commit f1c2b27 into main Sep 19, 2024
3 of 5 checks passed
@mishig25 mishig25 deleted the diffusers-prompting-improvements branch September 19, 2024 13:46
mishig25 added a commit that referenced this pull request Sep 20, 2024
mishig25 added a commit that referenced this pull request Sep 20, 2024
mishig25 added a commit that referenced this pull request Sep 20, 2024
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