replicate-python
replicate-python copied to clipboard
Python client for Replicate
There was a discussion in https://github.com/replicate/replicate-python/issues/152 that Prediction class instance now provides progress information. But I don't thinks it's working as expected. Could you please have a look at this...
If you try to pass a large file it fails because the data URL is too large. ``` replicate.exceptions.ReplicateError: HTTP error: (413, 'Request Entity Too Large') ``` The solution is...
This should work: ```python import replicate from urllib.request import urlretrieve model = replicate.models.get("stability-ai/stable-diffusion") version = model.versions.get("27b93a2413e7f36cd83da926f3656280b2931564ff050bf9575f1fdf9bcd7478") out = version.predict(prompt="wavy colorful abstract patterns, cgsociety" background = Image.open(out) ``` See #48 #66
Original post from Slack: https://replicatehq.slack.com/archives/C04AXJ6BR34/p1687821981253489 This was resolved temporarily with this workaround: ``` from replicate.prediction import Prediction as OriginalPrediction from pydantic import Field ``` ``` class Prediction(OriginalPrediction): version: str =...
Followup to https://github.com/replicate/replicate-python/pull/82
They can be file objects or URLs.
``` RESPONSE=$(curl -X POST -H "Authorization: Token $REPLICATE_API_TOKEN" https://dreambooth-api-experimental.replicate.com/v1/upload/data.zip) curl -X PUT -H "Content-Type: application/zip" --upload-file data.zip "$(jq -r ".upload_url"
The client should validate inputs based on the schema before making an API call. ## User data - #25
In `wait()` and `output_iterator()` we should be smarter about our polling speed. Start quick, to handle fast predictions, then slow down if prediction hasn't started, then speed up when prediction...
The Replicate HTTP API is the same as the Cog HTTP API. (Or, is intended to be.) It'd be neat if under the hood, there was a single Python client...