StefH / Replicate.Net

A C# RestEase client for Replicate (A latent text-to-image diffusion model capable of generating photo-realistic images given any text input).
MIT License
17 stars 5 forks source link

Project Icon Replicate.Net

A C# client (using RestEase) for Replicate: A latent text-to-image diffusion model capable of generating photo-realistic images given any text input.

It implements the HTTP API from Replicate](https://replicate.com).

Install

NuGet Badge Main project
NuGet Badge Support for Microsoft DependencyInjection

Example (using Factory)

var factory = new PredictionsApiFactory();

var replicateApi = factory.GetApi("{token}");

var request = new Request
{
    Version = "a9758cbfbd5f3c2094457d996681af52552901775aa2d6dd0b17fd15df959bef",
    Input = new DefaultPredictionInput
    {
        Prompt = "a gentleman cat with blue eyes wearing a tophat in a 19th century portrait"
    }
};

var response = await replicateApi.CreatePredictionAndWaitOnResultAsync(request).ConfigureAwait(false);

Example (using DependencyInjection)

// ---
    services.AddReplicateClient("{token}");
// ---

var replicateApi = // injected

// Now call the api

Example WinForms application

example-winform


References