TensorStack.HuggingFace
0.14.2
Prefix Reserved
dotnet add package TensorStack.HuggingFace --version 0.14.2
NuGet\Install-Package TensorStack.HuggingFace -Version 0.14.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TensorStack.HuggingFace" Version="0.14.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TensorStack.HuggingFace" Version="0.14.2" />
<PackageReference Include="TensorStack.HuggingFace" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TensorStack.HuggingFace --version 0.14.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: TensorStack.HuggingFace, 0.14.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TensorStack.HuggingFace@0.14.2
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TensorStack.HuggingFace&version=0.14.2
#tool nuget:?package=TensorStack.HuggingFace&version=0.14.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
TensorStack.HuggingFace
Basic .NET Wrapper API for HuggingFace Diffusers & Transformers
Python Pipelines
Generate an image using Qwen-Image-Edit
using (var backend = new HuggingFaceBackend(VendorType.Nvidia))
{
await backend.InitializeAsync();
// Pipeline Config
var pipelineConfig = new PipelineConfig
{
Path = "Qwen/Qwen-Image-Edit",
Pipeline = "QwenImagePipeline",
ProcessType = ProcessType.ImageEdit,
DataType = DataType.Bfloat16,
MemoryMode = MemoryModeType.OffloadCPU
};
// Create Pipeline Proxy
using (var pythonPipeline = new PythonPipeline(pipelineConfig, PipelineProgress.ConsoleCallback))
{
// Download/Load Model
await pythonPipeline.LoadAsync();
// Generate Option
var options = new PipelineOptions
{
Prompt = "Yarn art style",
Steps = 30,
Width = 1024,
Height = 1024,
GuidanceScale = 4f,
Scheduler = SchedulerType.FlowMatchEulerDiscrete,
ImageInput = new ImageInput("Image.png")
};
// Generate
var response = await pythonPipeline.GenerateAsync(options);
// Save Image
await response
.AsImageTensor()
.SaveAsync("Result.png");
}
}
HuggingFace Backends
The HuggingFaceBackend class to manage HuggingFace backend environments. You can initialize a backend using built-in vendor configurations or provide a custom configuration to control its version, installation directory, and requirements.
Basic Documentation
// Create a backend using built-in vendor defaults.
var backend = new HuggingFaceBackend(VendorType.Nvidia);
// Initialize the environment.
// Attempts to load an existing environment, update it if loading
// fails, or create a new environment if necessary.
bool initialized = await backend.InitializeAsync();
// Load the environment directly.
bool loaded = await backend.LoadAsync();
// Perform a specific setup operation.
bool updated = await backend.SetupAsync(BackendStatus.Update);
// Delete the backend environment.
bool deleted = await backend.DeleteAsync();
// Check whether the backend environment exists.
bool exists = backend.Exists();
// ============================================================
// Backend Setup Operations
// ============================================================
// Create - Create a new environment.
// Load - Load operation status.
// Update - Update an existing environment.
// Rebuild - Rebuild the environment.
// Reinstall - Reinstall the environment.
bool success = await backend.SetupAsync(BackendStatus.Create);
// ============================================================
// Custom Configuration
// ============================================================
// Name - Backend name
// Version - Python version (Supported: 3.12, 3.13, 3.14)
// Directory - Backend directory
// Requirements - List of python package requiremnets.
// Define a custom backend configuration.
var customConfiguration = new BackendConfig
{
Name = "cuda",
Version = "3.12",
Directory = "HuggingFace",
Requirements =
[
"your custom python requirements",
// Include Default Requirements
.. HuggingFaceBackend.DefaultRequirements
]
};
// Create a backend using the custom configuration.
var customBackend = new HuggingFaceBackend(customConfiguration);
// ============================================================
// Built-in Configuration Customization
// ============================================================
// Retrieve a built-in vendor configuration.
BackendConfig configuration = HuggingFaceBackend.GetConfig(VendorType.Nvidia);
// Create a modified copy of the configuration.
// BackendConfig is a record, so the original remains unchanged.
var modifiedConfiguration = configuration with
{
Name = "cuda-test",
Version = "3.14",
Directory = "My Location"
};
// Create a backend using the modified configuration.
var modifiedBackend = new HuggingFaceBackend(modifiedConfiguration);
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-windows10.0.17763 is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0-windows10.0.17763
- Microsoft.Extensions.Logging (>= 10.0.13)
- TensorStack.Common (>= 0.14.2)
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.14.2 | 44 | 10/20/2026 |
| 0.14.1 | 107 | 10/16/2026 |
| 0.13.13 | 96 | 10/11/2026 |
| 0.13.12 | 93 | 10/10/2026 |
| 0.13.10 | 119 | 10/6/2026 |
| 0.13.9 | 89 | 10/5/2026 |
| 0.13.8 | 101 | 10/4/2026 |
| 0.13.7 | 97 | 10/4/2026 |
| 0.13.6 | 106 | 10/2/2026 |
| 0.13.5 | 106 | 9/30/2026 |
| 0.13.4 | 112 | 9/27/2026 |
| 0.13.3 | 102 | 9/25/2026 |
| 0.13.2 | 102 | 9/25/2026 |
| 0.13.1 | 117 | 9/21/2026 |
| 0.13.0 | 97 | 9/20/2026 |
| 0.12.11 | 143 | 9/12/2026 |
| 0.12.9 | 102 | 9/11/2026 |
| 0.12.7 | 122 | 9/7/2026 |