-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #79 from teknologi-umum/ai-overhaul
Use Stability SDXL 1.0 for image generation
- Loading branch information
Showing
8 changed files
with
194 additions
and
690 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace BotNet.Services.Stability.Models { | ||
internal sealed record TextToImageResponse( | ||
List<Artifact> Artifacts | ||
); | ||
|
||
internal sealed record Artifact( | ||
string Base64, | ||
string FinishReason, | ||
int Seed | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace BotNet.Services.Stability.Skills { | ||
public sealed class ImageGenerationBot( | ||
StabilityClient stabilityClient | ||
) { | ||
private readonly StabilityClient _stabilityClient = stabilityClient; | ||
|
||
public async Task<byte[]> GenerateImageAsync( | ||
string prompt, | ||
CancellationToken cancellationToken | ||
) { | ||
return await _stabilityClient.GenerateImageAsync( | ||
engine: "stable-diffusion-xl-1024-v1-0", | ||
promptText: prompt, | ||
cancellationToken: cancellationToken | ||
); | ||
} | ||
} | ||
} |
Oops, something went wrong.