Add Replicate quickstart
Browse files
README.md
CHANGED
|
@@ -21,7 +21,14 @@ Replicate lets developers run, fine-tune, and deploy open models with a producti
|
|
| 21 |
|
| 22 |
Use Replicate infrastructure through Hugging Face's standard Inference Providers interface. You can call image, video, speech, and audio models with the same `InferenceClient`, your existing `HF_TOKEN`, and a provider switch instead of wiring up a separate integration path.
|
| 23 |
|
| 24 |
-
## Get started
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
```python
|
| 27 |
import os
|
|
@@ -36,3 +43,8 @@ image = client.text_to_image(
|
|
| 36 |
"A cinematic photo of an astronaut riding a horse",
|
| 37 |
model="Tongyi-MAI/Z-Image-Turbo",
|
| 38 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
Use Replicate infrastructure through Hugging Face's standard Inference Providers interface. You can call image, video, speech, and audio models with the same `InferenceClient`, your existing `HF_TOKEN`, and a provider switch instead of wiring up a separate integration path.
|
| 23 |
|
| 24 |
+
## Get started in 30 seconds
|
| 25 |
+
|
| 26 |
+
Install the Hub client, set your token, generate an image, and save it locally:
|
| 27 |
+
|
| 28 |
+
```bash
|
| 29 |
+
pip install huggingface_hub pillow
|
| 30 |
+
export HF_TOKEN=hf_...
|
| 31 |
+
```
|
| 32 |
|
| 33 |
```python
|
| 34 |
import os
|
|
|
|
| 43 |
"A cinematic photo of an astronaut riding a horse",
|
| 44 |
model="Tongyi-MAI/Z-Image-Turbo",
|
| 45 |
)
|
| 46 |
+
|
| 47 |
+
image.save("replicate-astronaut.png")
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
For JavaScript, cURL, and task-specific examples, see the [Replicate provider docs](https://huggingface.co/docs/inference-providers/providers/replicate).
|