AIKernel.Providers.Flux.Cuda
0.1.5
dotnet add package AIKernel.Providers.Flux.Cuda --version 0.1.5
NuGet\Install-Package AIKernel.Providers.Flux.Cuda -Version 0.1.5
<PackageReference Include="AIKernel.Providers.Flux.Cuda" Version="0.1.5" />
<PackageVersion Include="AIKernel.Providers.Flux.Cuda" Version="0.1.5" />
<PackageReference Include="AIKernel.Providers.Flux.Cuda" />
paket add AIKernel.Providers.Flux.Cuda --version 0.1.5
#r "nuget: AIKernel.Providers.Flux.Cuda, 0.1.5"
#:package AIKernel.Providers.Flux.Cuda@0.1.5
#addin nuget:?package=AIKernel.Providers.Flux.Cuda&version=0.1.5
#tool nuget:?package=AIKernel.Providers.Flux.Cuda&version=0.1.5
AIKernel FLUX.2 CUDA image editing provider
FluxCudaImageProvider edits RGB24 reference images with FLUX.2 [klein] 4B. The package targets .NET 10 and Windows x64. It uses the same IImagePromptEditProvider contract and registered checkpoints as the CPU package.
using AIKernel.Contracts.Images;
using AIKernel.Providers.Flux;
using var runtime = new FluxCudaImageProvider(modelDirectory, privateSsdDirectory,
weightCacheMiB: 256, deviceOrdinal: 0, deviceCacheMiB: 64);
IImagePromptEditProvider editor = runtime;
var edited = await editor.EditAsync(rgb24, width, height,
"Make the jacket blue and preserve the composition.", seed: 42, cancellationToken);
Use an AVX2-capable host with the Microsoft Visual C++ Redistributable, an NVIDIA driver compatible with CUDA 13.2, and the CUDA 13.2 runtime and cuBLAS DLLs on PATH. The package contains the FLUX bridge. Install the model files and the NVIDIA runtime separately. Device ordinals follow CUDA device visibility in the application process.
AIKernel bounds the RAM and GPU checkpoint caches separately. For compatible tensor layouts, the native loader borrows each resident GPU page and copies into the engine's CUDA tensor allocation. Tensors that require conversion use the host reader before upload. The GPU page budget covers the checkpoint cache. Tensor staging, activations, and decoder workspace also need physical memory. A failed CUDA edit returns an error to the application.
LastWeightStatistics reports resident cache bytes, logical SSD checkpoint reads, device page-ins, and the number of tensor reads delivered to host and device memory. The logical SSD reads count requests to the checkpoint source and may be served by the OS file cache.
Build
Use the pinned engine and submodule revisions from the CPU build guide. Set $engine to that checkout and $cudaToolkit to the CUDA 13.2 toolkit directory. Run these commands in a Visual Studio x64 developer terminal from the AIKernel.Providers.Flux.Cuda directory.
cmake -S ../AIKernel.Providers.Flux/native -B native-build-cuda -G Ninja `
-DCMAKE_BUILD_TYPE=Release -DAIKERNEL_FLUX_CUDA=ON `
'-DCMAKE_CUDA_ARCHITECTURES=75-real;86-real;89-real;89-virtual' `
"-DAIKERNEL_FLUX_ENGINE=$engine" "-DCUDAToolkit_ROOT=$cudaToolkit" `
"-DCMAKE_CUDA_COMPILER=$cudaToolkit/bin/nvcc.exe"
cmake --build native-build-cuda --parallel 4
dotnet pack -c Release -p:UseAIKernelContractSource=false `
"-p:FluxCudaNativeLibrary=$((Resolve-Path native-build-cuda/aikernel_flux_cuda.dll).Path)"
This build emits native code for SM 7.5, 8.6 and 8.9, plus PTX for compute capability 8.9. Adjust the architecture list for other boards. The CMake build leaves the upstream checkout untouched. It checks both revisions and generates a tensor-loader translation unit with the ABI callbacks.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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
- AIKernel.Contracts.Images (>= 0.1.5)
- AIKernel.Kernel (= 0.1.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.5 | 64 | 11/23/2026 |
Initial separate CUDA package for FLUX.2 klein 4B image editing.