Skip to content

Generated C# SDK based on official Replicate OpenAPI specification

License

Notifications You must be signed in to change notification settings

tryAGI/Replicate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Replicate

Nuget package dotnet License: MIT Discord

Features 🔥

  • Fully generated C# SDK based on official Replicate OpenAPI specification using OpenApiGenerator
  • Same day update to support new features
  • Updated and supported automatically if there are no breaking changes
  • All modern .NET features - nullability, trimming, NativeAOT, etc.
  • Support .Net Framework/.Net Standard 2.0

Documentation

Examples and documentation can be found here: https://tryagi.github.io/Replicate/

Usage

using Replicate;

using var api = new ReplicateApi(apiKey);
var response = await api.ModelsPredictionsCreateAsync(
    input: new PredictionRequestInput
    {
        AdditionalProperties = new Dictionary<string, object>
        {
            ["seed"] = Random.Shared.Next(0, 1000000),
            ["steps"] = 25,
            ["prompt"] = "a female, european, young adult, fit body, wavy acid orange hair, wearing open swimsuit, sea in the background.",
            ["guidance"] = 3.5,
            ["interval"] = 3,
            ["aspect_ratio"] = "16:9",
            ["safety_tolerance"] = 5,
        },
    },
    modelOwner: "black-forest-labs",
    modelName: "flux-pro");
        
var endResponse = await response.WaitUntilSuccessfulAsync(api);

Console.WriteLine($@"Seed: {endResponse.Input?.Seed}.
Image available at:\n{endResponse.Output}");

output

Support

Priority place for bugs: https://github.com/tryAGI/Replicate/issues
Priority place for ideas and general questions: https://github.com/tryAGI/Replicate/discussions
Discord: https://discord.gg/Ca2xhfBf3v

Acknowledgments

JetBrains logo

This project is supported by JetBrains through the Open Source Support Program.

CodeRabbit logo

This project is supported by CodeRabbit through the Open Source Support Program.