Replicate API Added! #47
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey @ToTheBeginning & @cabelo 👋
DreamO is a really cool model for customizing images, especially with its different ways to work with faces, objects, and styles.
So people can try DreamO and use it in their own projects, I've set it up to run on Replicate:
Demo & API: https://replicate.com/zsxkib/dream-o
I also posted about it on X/Twitter here: https://x.com/zsakib_/status/1923337566247322039
What's new in this PR:
This PR adds the files and settings needed to run the DreamO model on Replicate:
predict.py
: This script loads the DreamO model and lets you run it using Cog. It handles the different creative tasks and prepares your input images.cog.yaml
: This file tells Replicate about the Python environment, system packages, and GPU needed for DreamO..dockerignore
: This helps make the Docker build faster by telling it to skip files that aren't needed..gitignore
: This makes sure Replicate and Cog files (like.cog/
and/model_cache/
) don't get accidentally added to the main project.README.md
: I've updated this to include a Replicate badge that links to the demo page, plus a section explaining how to use DreamO with Replicate or run it locally with Cog.With this setup, you get:
cog predict
, and it will download the necessary weights for you.How to use it with Replicate's API:
First, install the Python client:
Then, set your API token (you can find this in your Replicate account settings):
export REPLICATE_API_TOKEN=[YOUR_REPLICATE_API_TOKEN]
Now you can run the model in Python like this:
How to run it locally with Cog:
After you've cloned the repository and opened it in your terminal (
cd
into the directory):The weights and other needed files will download automatically the first time you run it.
On Replicate, people using the model pay for their own computer time, which helps keep things available for everyone, even if a model gets popular.
Let me know if you have any questions or ideas for making this better. I'm happy to change things.
Thanks for making DreamO open source!
-- Sakib @ Replicate