Skip to content

Hedra

Nuget package dotnet License: MIT Discord

Features 🔥

  • Fully generated C# SDK based on official Hedra OpenAPI specification using AutoSDK
  • 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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using Hedra;

using var client = new HedraClient(apiKey);

UploadAudioResponseBody uploadAudio = await client.Audio.UploadAudioAsync(
    file: H.Resources.hello_wav.AsBytes(),
    filename: H.Resources.hello_wav.FileName);
UploadAudioResponseBody uploadImage = await client.Portrait.UploadImageAsync(
    file: H.Resources.girl_png.AsBytes(),
    filename: H.Resources.girl_png.FileName);

ApiProjectInitializationResponseBody initializeCharacter = await client.Characters.InitializeCharacterGenerationAsync(
    audioSource: ApiGenerateTalkingAvatarRequestBodyAudioSource.Audio,
    avatarImage: uploadImage.Url,
    voiceUrl: uploadAudio.Url);

Console.WriteLine($"JobId: {initializeCharacter.JobId}");

AvatarProjectItem projectStatus;
do
{
    await Task.Delay(TimeSpan.FromSeconds(5));

    projectStatus = await client.Projects.GetProjectAsync(
        projectId: initializeCharacter.JobId);
}
while (projectStatus.VideoUrl == null && projectStatus.ErrorMessage == null);

if (projectStatus.ErrorMessage != null)
{
    Console.WriteLine($"Error: {projectStatus.ErrorMessage}");
}
Console.WriteLine(projectStatus.VideoUrl);

Input Image

https://github.com/user-attachments/assets/7ba25d24-0bcb-4dd4-9975-9e636533fbe9

Support

Priority place for bugs: https://github.com/tryAGI/Hedra/issues
Priority place for ideas and general questions: https://github.com/tryAGI/Hedra/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.