File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -542,13 +542,17 @@ The validation logic is identical; only import paths may differ.
542542
543543## Experimental use() interface
544544
545- The experimental ` use() ` interface is available in both versions with similar functionality. V2 adds async support.
545+ The experimental ` use() ` interface is available in both versions with similar functionality.
546546
547547### Before (v1)
548548
549549``` python
550550flux = replicate.use(" black-forest-labs/flux-schnell" )
551551outputs = flux(prompt = " astronaut on a horse" )
552+
553+ # Async support
554+ async_flux = replicate.use(" black-forest-labs/flux-schnell" )
555+ outputs = await async_flux(prompt = " astronaut on a horse" )
552556```
553557
554558### After (v2)
@@ -558,7 +562,7 @@ outputs = flux(prompt="astronaut on a horse")
558562flux = replicate.use(" black-forest-labs/flux-schnell" )
559563outputs = flux(prompt = " astronaut on a horse" )
560564
561- # NEW: Async support
565+ # Async support (uses use_async parameter)
562566async_flux = replicate.use(" black-forest-labs/flux-schnell" , use_async = True )
563567outputs = await async_flux(prompt = " astronaut on a horse" )
564568```
You can’t perform that action at this time.
0 commit comments