- Go to replicate.com
- Create an account
- Add your payment method
- Generate an API key
- Add the API key in the plugin tab on Bubble
- Use the functions in your workflows actions
For each action you will have the option to specify a webhook or not :
- If empty, the workflow will be blocked until the generation is completed. It can be used in client-side only on very fast model (because it timeout after 30s). It is advised to use them in backend workflow only.
- If a webhook is set, the action will return a prediction_id that you can use at later use. The webhook url specified will be called once the generation is completed.
To expose an API with URL to use as a Webhook you can check this tuto on YouTube (from 30min) :
https://youtu.be/T6zXcy5uLmI?si=GYlm3852Do2Yc0W4&t=1802For some text model you will be able to stream the output :
- To use the streaming with text models, you will have to add the element "LLM - Streaming" in your page and give it the stream url.
- The stream url is returned when calling a generation, you will have to set the field "Stream ?" in "yes" to have it returned.
Typical workflow to generate images with SD15 or SDXL :
- Create a new type in your BDD : "Generated Images"
- Give it few fields like :
--- prompt
--- prediction_id
--- user
--- imgs
--- ...
- Add an input in your page and a button
- Add a workflow When the button element is clicked
- Add the action to create an image with SDXL and set the prompt and webhook :
- Add a backend workflow that will be the webhook when the prediction is completed
- In this backend workflow you will get the "Generated Images" thanks to the prediction_id that will be in the data returned to your webhook
- Make a change to the "Generated Images" found with the prediction_id and set it the list of the images returned to your webhook
- On your front-end add a repeating group to display the images of your "Generated Images"
I will do videos to explain how to use the different models.
Editor :
https://bubble.io/page?id=vima-plugin-replicate&test_plugin=1696261966525x696943153136009200_current&tab=Workflow&name=replicate&type=pageany bug or suggestion, any model you'd like to see added ?
contact
[email protected]