HartsyInference.Vulkan
2.0.0-alpha.16
dotnet add package HartsyInference.Vulkan --version 2.0.0-alpha.16
NuGet\Install-Package HartsyInference.Vulkan -Version 2.0.0-alpha.16
<PackageReference Include="HartsyInference.Vulkan" Version="2.0.0-alpha.16" />
<PackageVersion Include="HartsyInference.Vulkan" Version="2.0.0-alpha.16" />
<PackageReference Include="HartsyInference.Vulkan" />
paket add HartsyInference.Vulkan --version 2.0.0-alpha.16
#r "nuget: HartsyInference.Vulkan, 2.0.0-alpha.16"
#:package HartsyInference.Vulkan@2.0.0-alpha.16
#addin nuget:?package=HartsyInference.Vulkan&version=2.0.0-alpha.16&prerelease
#tool nuget:?package=HartsyInference.Vulkan&version=2.0.0-alpha.16&prerelease
HartsyInference
Run Flux, Qwen-Image, Wan, Whisper, Llama and 100+ other models from C#. No Python. No venv. No subprocess.
A complete AI inference engine written entirely in C#. It loads .safetensors, .gguf and PyTorch
checkpoints directly and runs them on CUDA, Vulkan or CPU — as NuGet packages you reference
from a .NET app. Nothing to install beyond your GPU driver.
Not a wrapper: the CUDA kernels are hand-written PTX loaded through the Driver API, the Vulkan kernels are SPIR-V, the CPU kernels are AVX2/AVX-512/NEON intrinsics.
⚠️ Alpha
Verified across a wide model set and in daily use, but public APIs still change between releases. Pin an exact version. Some models are built but not yet verified end-to-end, and video performance is still being optimized. Status is tracked openly — see the links at the bottom.
Install
dotnet add package HartsyInference # everything
dotnet add package HartsyInference.Diffusion # or just the modality you need
Generate an image
InferenceEngine is the facade — it owns model loading, caching and generation for every modality.
using HartsyInference.Engine;
using HartsyInference.Engine.Dispatch;
using HartsyInference.Engine.Requests;
using var engine = new InferenceEngine("cuda"); // "cpu", "vulkan", "cuda:1", "auto"
ImageResult image = await engine.Images.GenerateAsync(
new ModelSpec { Requested = "sdxl", Modality = Modality.Image, LocalPath = "sdxl.safetensors" },
new ImageRequest { Prompt = "a castle on a mountain at sunset, oil painting", Steps = 25 });
// image.Rgb is RGB24 bytes, image.Width × image.Height
Stream tokens from a local LLM
var spec = new ModelSpec { Requested = "qwen3", Modality = Modality.Text, LocalPath = "Qwen3-4B-Q4_K_M.gguf" };
var request = new TextRequest
{
Messages = [new TextMessage { Role = TextRole.User, Content = "Explain flow matching." }],
};
await foreach (TextChunk chunk in engine.Text.StreamAsync(spec, request))
if (chunk.Kind == TextChunkKind.Chunk)
Console.Write(chunk.Text);
Every modality follows the same shape: engine.Images, engine.Text, engine.Video, engine.Speech,
engine.Transcribe, engine.Music, engine.Vision, engine.Mesh, engine.World, engine.Restore,
engine.VoiceConversion, engine.Fx, engine.Embeddings.
Performance
Faster than ComfyUI on the models most people run — same GPU, same checkpoint, same steps (RTX 4090): Flux-Schnell 2.4 s vs 3.8 s, Krea2-Turbo 4.5 s vs 6.5 s, Qwen-Image 20B 40.6 s vs 58.2 s, Flux-Dev 9.5 s vs 12.5 s. SDXL and Lumina 2 still trail; most video DiTs still trail.
Text decode beats llama.cpp at matched GGUF and quant on a 12 GB RTX 3060: Qwen2.5-0.5B 435.6 vs 328.9 tok/s, Gemma-3-1B 251.3 vs 196.8, Llama-3.2-1B 213.7 vs 192.0.
Full tables, including the losses, are in the repo under benchmarks/scoreboards/.
What it can run
- Image — SD1.5, SDXL, Flux.1/.2, SD3.5, Qwen-Image (+Edit), Chroma, Krea 2, Z-Image, HiDream, AuraFlow, Lumina 2, Kandinsky 5, OmniGen 2, Ideogram 4. ControlNet, IP-Adapter (incl. FaceID), LoRA, img2img and inpaint.
- Video — Wan 2.1/2.2, HunyuanVideo 13B, LTX-Video + LTX-2.3, MiniMax-H3, Kandinsky 5, plus SeedVR2 video/image restoration.
- LLM — Llama, Qwen2/3, Gemma 2/3/4, Phi, Mistral, MoE giants, Mamba/RWKV, VLMs, embeddings and rerankers. GGUF quantized throughout, device-resident KV cache, chat templates.
- Audio — Whisper and Moonshine (STT); Kokoro, Piper, StyleTTS2, F5-TTS, CosyVoice, VibeVoice, Bark (TTS); ACE-Step, MusicGen, YuE (music); 9 neural codecs; voice conversion, stem separation, enhancement.
- Vision — CLIP / SigLIP / DINOv2, YOLOv8/11, RT-DETR, Grounding DINO, SAM 2, Depth-Anything-V2.
- 3D — TripoSR, Hunyuan3D-2 (image → mesh, glTF/OBJ/PLY).
- World — Oasis, DIAMOND (action-conditioned real-time frame generation).
Beyond one GPU
Memory-mapped weights run models far larger than VRAM — MiniMax-H3's 66 GB bf16 DiT is verified end-to-end on a 12 GB RTX 3060, loading at 943 MB RSS. One model can also be split across several GPUs with the VRAM pooled, over plain PCIe with no NVLink or P2P required: LLM layer splits, DiT block sharding, text-encoder/VAE placement, and CFG-parallel branches.
Packages
HartsyInference is a meta-package pulling in the core, all three backends and every modality. Reference
individually if you only need one:
Core · ModelAssets (+ .Tokenizers) · Cpu · Cuda · Vulkan · LLM · Diffusion · Audio
(+ .Phonemizer) · Vision · Video · ThreeD · World
Dependencies flow one way and GPU code stays behind IBackend, so a CPU-only package never drags in CUDA
or Vulkan.
Requirements
.NET 8 or .NET 10. For CUDA: an NVIDIA GPU with compute capability 8.0+ and CUDA 12.x/13.x userspace libraries (FP8 paths need 8.9+; cuDNN 9.21+ optional for fused flash attention). For Vulkan: a Vulkan 1.3+ runtime and FP16 compute — most discrete GPUs from 2019+. The CPU backend needs nothing.
Links
GitHub · SwarmUI backend extension · Model status · Benchmarks · Roadmap
Prefer a UI? The SwarmUI backend extension registers HartsyInference as a pure-C# alternative to the ComfyUI backend — full generation UI, model browser and parameter controls, with no Python environment.
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- HartsyInference.Core (>= 2.0.0-alpha.16)
- HartsyInference.Cpu (>= 2.0.0-alpha.16)
-
net8.0
- HartsyInference.Core (>= 2.0.0-alpha.16)
- HartsyInference.Cpu (>= 2.0.0-alpha.16)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on HartsyInference.Vulkan:
| Package | Downloads |
|---|---|
|
HartsyInference
Meta-package for HartsyInference — a pure C#/.NET AI inference engine for non-LLM modalities (diffusion image generation, speech-to-text, text-to-speech, vision, video, interactive world models). Adds all backends (CPU, CUDA, Vulkan) and modality packages in one reference. |
|
|
HartsyInference.Engine
The HartsyInference service layer: the single entry point for loading models and generating across every modality. Consumed by the CLI, the HTTP API, and the SwarmUI backend extension. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0-alpha.16 | 17 | 8/7/2026 |
| 2.0.0-alpha.15 | 36 | 8/7/2026 |
| 2.0.0-alpha.14 | 38 | 8/6/2026 |
| 2.0.0-alpha.12 | 38 | 8/6/2026 |
| 2.0.0-alpha.11 | 33 | 8/5/2026 |
| 2.0.0-alpha.10 | 60 | 8/3/2026 |
| 2.0.0-alpha.9 | 56 | 8/2/2026 |
| 2.0.0-alpha.8 | 60 | 8/2/2026 |
| 2.0.0-alpha.6 | 52 | 8/1/2026 |
| 2.0.0-alpha.5 | 58 | 7/28/2026 |
| 2.0.0-alpha.4 | 65 | 7/26/2026 |
| 2.0.0-alpha.3 | 62 | 7/25/2026 |
| 2.0.0-alpha.1 | 67 | 7/22/2026 |
| 1.0.0-alpha.52 | 60 | 7/18/2026 |
| 1.0.0-alpha.51 | 52 | 7/18/2026 |
| 1.0.0-alpha.50 | 52 | 7/18/2026 |
| 1.0.0-alpha.49 | 59 | 7/16/2026 |
| 1.0.0-alpha.48 | 63 | 7/12/2026 |
| 1.0.0-alpha.47 | 65 | 7/10/2026 |
| 1.0.0-alpha.46 | 65 | 7/9/2026 |