vehm / placeholdr

AI-Powered Placeholder Image Provider
https://placeholdr.ai
MIT License
3 stars 0 forks source link

Allow prompting through url endpoint #25

Open Logan-Mart opened 3 months ago

Logan-Mart commented 3 months ago

I think it'd be useful if instead of having to visit the site, you can streamline the process by enabling users to directly add their prompt to the URL endpoint, so you don't have to alt tab out of your IDE and grab the session id. Please add this feature, and let me know if collaborative work is up for discussion.

vehm commented 3 months ago

This is a good idea, however there would be limitations due to how it is being stored in the backend.

Currently, when a user submits the form on the website it queues three image generations and links those two a single session ID. If a user were to only supply the prompt, we would be relying on the uniqueness of the provided prompt since they wouldn't have an ID to link their particular request to. This would be pretty unavoidable, as far as I can tell, and I'd probably make it to where it simply grabs the most recent submission where the prompt matches the provided prompt.

For instance, if a user were to prompt for "red phone" a day ago and I prompted for "red phone" right now, they would pull my generated images since our prompt was the same. Otherwise, we'd need some sort of unique identifier which I don't see how we could accomplish through only the URL params.

Another option would be to generate new images each request, but this would make my generation costs skyrocket.