An unofficial API wrapper for Craiyon (formerly DALL-E-MINI) to generate awesome images from text tokens.
Simplest and easiest to use.
Inspired by craiyon.py.
you can get it from NuGet!
..or just copy & paste codes in this repo
Install-Package Craiyon.NET -Version 0.0.1
dotnet add package Craiyon.NET --version 0.0.1
var craiyon = new Craiyon.CraiyonClient(); // Create new instance
var images = craiyon.GenerateImage("what you want to see"); // Generate images
images.SaveImages("directory", "filename"); // Save images
↓ when you set "filename"
to "craiyon-net"
var craiyon = new Craiyon.CraiyonClient(); // Create new instance
var images = craiyon.GenerateImageAsync("what you want to see"); // Generate images
var craiyon = new Craiyon.CraiyonClient(); // Create new instance
var images = craiyon.GenerateImage("what you want to see"); // Generate images
Bitmap[] bmps = images.ToBitmaps(); // Get bitmaps
Since System.Drawing.Commons does not work on macOS, images need to be saved from byte arrays.
var craiyon = new Craiyon.CraiyonClient(); // Create new instance
var images = craiyon.GenerateImage("what you want to see"); // Generate images
byte[][] byteArrayImgs = images.ToByteArrays(); // Get byte arrays
for (int i = 0; i < byteArrayImgs.Length; i++) {
var ms = new System.IO.MemoryStream(byteArrayImgs[i]);
var fs = new System.IO.FileStream("filepath to save", FileMode.Create)
ms.WriteTo(fs); // Write image data to filestream
}