Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Releases: replicate/replicate-python

1.1.0b1

09 Jun 21:23
Compare
Choose a tag to compare
Loading
1.1.0b1Pre-release
Pre-release

What's Changed

The main change in1.1.0b1 is the introduction of a new experimentalreplicate.use() function intended to eventually replacereplicate.run(). This provides a more expressive function-like interface for calling models.

import replicateflux_dev = replicate.use("black-forest-labs/flux-dev")outputs = flux_dev(prompt="a cat wearing an amusing hat")for output in outputs:    print(output) # /tmp/output.webp

Check out theREADME.md on thebeta branch for more details.

  • Switch to usinguv for project tooling by@aron in#437
  • Add experimentalreplicate.use() function by@aron in#438

Full Changelog:1.0.7...1.1.0b1

Contributors

  • @aron
aron
Loading

1.0.7

27 May 11:34
Compare
Choose a tag to compare
Loading

What's Changed

If you run replicate-python within a cog model runningcog 0.14.11 or later, it is now possible to pass aREPLICATE_API_TOKEN via thecontext as part of a prediction request.

TheReplicate() constructor will now use this context when available. This grants cog models the ability to use the Replicate client libraries, scoped to a user on a per request basis.

Full Changelog:1.0.6...1.0.7

Assets2
Loading

1.0.6

27 May 11:26
Compare
Choose a tag to compare
Loading

Full Changelog:1.0.4...1.0.6

There was no 1.0.5 release, the release system failed and we chose not to re-use the identifier.

Loading

1.0.4

25 Nov 12:44
461ec70
This commit was created on GitHub.com and signed with GitHub’sverified signature.
GPG key ID:B5690EEEBB952194
Verified
Learn about vigilant mode.
Compare
Choose a tag to compare
Loading

What's Changed

  • Fix two bugs in the base64 file_encoding_strategy by@aron in#398
    • replicate.run() now correctly converts the file provided into a valid base64 encoded data URL.
    • replicate.async_run() now respects thefile_encoding_strategy flag.

Full Changelog:1.0.3...1.0.4

Contributors

  • @aron
aron
Loading

1.0.3

28 Oct 11:22
1.0.3
This tag was signed with the committer’sverified signature.
nickstenning Nick Stenning
SSH Key Fingerprint:YLf961ox+bECIWh5yybQFJRMQcIX0m+sQ2y5Z07eHKc
Verified
Learn about vigilant mode.
a54a786
This commit was created on GitHub.com and signed with GitHub’sverified signature.
GPG key ID:B5690EEEBB952194
Verified
Learn about vigilant mode.
Compare
Choose a tag to compare
Loading

What's Changed

  • Fix a bug wherereplicate.run would swallow tokens (or files) at the start of a prediction's output. Thanks to@aron in#383

Full Changelog:1.0.2...1.0.3

Contributors

  • @aron
aron
Loading

1.0.2

16 Oct 14:59
23bd903
This commit was created on GitHub.com and signed with GitHub’sverified signature.
GPG key ID:B5690EEEBB952194
Verified
Learn about vigilant mode.
Compare
Choose a tag to compare
Loading

What's Changed

  • Configure read timeout based onwait parameter by@aron in#373

Full Changelog:1.0.1...1.0.2

Contributors

  • @aron
aron
Loading

1.0.1

14 Oct 09:27
Compare
Choose a tag to compare
Loading

What's Changed

Full Changelog:1.0.0...1.0.1

Contributors

  • @zeke
zeke
Loading
AusafG5 reacted with eyes emoji
1 person reacted

1.0.0

14 Oct 09:25
Compare
Choose a tag to compare
Loading

Warning

Breaking changes

This 1.0.0 latest release ofreplicate contains breaking changes. Thereplicate.run() method will now returnFileObjects rather than URL strings by default for models that output files.

TheFileObject implements an iterable object similar tohttpx.Response to make it easier to work with files and ensures that Replicate can deliver file data to the client in the most efficient manner possible.

For example:

[output]=replicate.run("black-forest-labs/flux-schnell",input={"prompt":"astronaut riding a rocket like a horse"},);

For most basic cases you'll want to utilize either theurl orread() fields depending on whether you want to directly consume the file or pass it on.

To access the file URL:

print(output.url)#=> "https://delivery.replicate.com/..."

To consume the file directly:

withopen('output.bin','wb')asfile:file.write(output.read())

Or for very large files they can be streamed:

withopen(file_path,'wb')asfile:forchunkinoutput:file.write(chunk)

Each of these methods has an equivalentasyncio API.

asyncwithaiofiles.open(filename,'w')asfile:awaitfile.write(awaitoutput.aread())asyncwithaiofiles.open(filename,'w')asfile:awaitforchunkinoutput:awaitfile.write(chunk)

For streaming responses from common frameworks, all support takingIterator types:

Django

@condition(etag_func=None)defstream_response(request):output=replicate.run("black-forest-labs/flux-schnell",input={...},use_file_output=True)returnHttpResponse(output,content_type='image/webp')

FastAPI

@app.get("/")asyncdefmain():output=replicate.run("black-forest-labs/flux-schnell",input={...},use_file_output=True)returnStreamingResponse(output)

Flask

@app.route('/stream')defstreamed_response():output=replicate.run("black-forest-labs/flux-schnell",input={...},use_file_output=True)returnapp.response_class(stream_with_context(output))

In case of breakages, in most instances, updating existing applications to calloutput.url should fix issues.

To revert to previous behaviour you can opt out ofFileOutput by passinguse_file_output=False to thereplicate.run() method.

constreplicate=replicate.run("acmecorp/acme-model",use_file_output=False);

Full Changelog:0.34.2...1.0.0

Loading

0.34.1

25 Sep 19:37
5458c51
This commit was signed with the committer’sverified signature.
mattt Mattt
SSH Key Fingerprint:e/W5h7fVORWrofLS7Jnmjmm2onvSm6P5ld+7rkphTLY
Verified
Learn about vigilant mode.
Compare
Choose a tag to compare
Loading

What's Changed

  • Consistently return Boolean for delete methods by@mattt in#359

Full Changelog:0.34.0...0.34.1

Contributors

  • @mattt
mattt
Loading

0.34.0

25 Sep 18:47
d5f5e27
This commit was signed with the committer’sverified signature.
mattt Mattt
SSH Key Fingerprint:e/W5h7fVORWrofLS7Jnmjmm2onvSm6P5ld+7rkphTLY
Verified
Learn about vigilant mode.
Compare
Choose a tag to compare
Loading

What's Changed

  • Addwait parameter to prediction creation methods by@mattt in#354
  • Adduse_file_output to streaming methods by@mattt in#355

Full Changelog:0.33.0...0.34.0

Contributors

  • @mattt
mattt
Loading
Previous13456
Previous

[8]ページ先頭

©2009-2025 Movatter.jp