推理提供商文档

Replicate

Hugging Face's logo
加入 Hugging Face 社区

并获得增强的文档体验

开始使用

Replicate

您可以在这里找到所有支持的Replicate模型

Replicate正在构建工具,以便所有软件工程师都能像使用普通软件一样使用AI。您应该能够像导入npm包一样导入一个图像生成器。您应该能够像在GitHub上fork项目一样轻松地自定义一个模型。

支持的任务

自动语音识别

详细了解自动语音识别 此处

import os
from huggingface_hub import InferenceClient

client = InferenceClient(
    provider="replicate",
    api_key=os.environ["HF_TOKEN"],
)

output = client.automatic_speech_recognition("sample1.flac", model="openai/whisper-large-v3")

图像到图像

在此处了解更多关于图像到图像的信息。

import os
from huggingface_hub import InferenceClient

client = InferenceClient(
    provider="replicate",
    api_key=os.environ["HF_TOKEN"],
)

with open("cat.png", "rb") as image_file:
   input_image = image_file.read()

# output is a PIL.Image object
image = client.image_to_image(
    input_image,
    prompt="Turn the cat into a tiger.",
    model="black-forest-labs/FLUX.2-klein-4B",
)

文本到图像

详细了解文本到图像 此处

import os
from huggingface_hub import InferenceClient

client = InferenceClient(
    provider="replicate",
    api_key=os.environ["HF_TOKEN"],
)

# output is a PIL.Image object
image = client.text_to_image(
    "Astronaut riding a horse",
    model="Tongyi-MAI/Z-Image-Turbo",
)

文本生成视频

在此处了解有关文本生成视频的更多信息

import os
from huggingface_hub import InferenceClient

client = InferenceClient(
    provider="replicate",
    api_key=os.environ["HF_TOKEN"],
)

video = client.text_to_video(
    "A young man walking on the street",
    model="Wan-AI/Wan2.2-T2V-A14B",
)
在 GitHub 上更新

© . This site is unofficial and not affiliated with Hugging Face, Inc.