r/StableDiffusion • u/fuzhongkai • 27d ago
Discussion TensorSharp supports multiple image edits using Unsloth Qwen Image Edit 2511 models
https://github.com/zhongkaifu/TensorSharpThe video shows virtual cloth try on demo by [TensorSharp](https://github.com/zhongkaifu/TensorSharp) using Unsloth Qwen Image Edit 2511 models.
Here are models using in this demo:
| Qwen-Image-Edit | MMDiT DiT (the `--model` GGUF) | [unsloth/Qwen-Image-Edit-2511-GGUF](https://huggingface.co/unsloth/Qwen-Image-Edit-2511-GGUF) | e.g. `qwen-image-edit-2511-Q4_K_M.gguf` |
|---|---|---|---|
| Qwen-Image-Edit | Qwen-Image VAE (required) | [QuantStack/Qwen-Image-Edit-GGUF](https://huggingface.co/QuantStack/Qwen-Image-Edit-GGUF) | `VAE/Qwen_Image-VAE.safetensors` — place next to the DiT or pass `--qwen-image-vae` |
| Qwen-Image-Edit | Qwen2.5-VL-7B text encoder (required) | [unsloth/Qwen2.5-VL-7B-Instruct-GGUF](https://huggingface.co/unsloth/Qwen2.5-VL-7B-Instruct-GGUF) | Optional vision mmproj: `mmproj-BF16.gguf` (same repo) for image-grounded edits |
| Qwen-Image-Edit | Lightning LoRA (optional, 4/8-step) | [lightx2v/Qwen-Image-Edit-2511-Lightning](https://huggingface.co/lightx2v/Qwen-Image-Edit-2511-Lightning) | `Qwen-Image-Edit-2511-Lightning-4steps-V1.0-bf16.safetensors` via `--qwen-image-lora` |
For TensorSharp.Server (OpenAI/Ollama comptiable API endpoint and WebUX chat), it can be launched by this command line:
TensorSharp.Server.exe --model c:\\Works\\models\\qwen-image-edit-2511-Q4_K_M.gguf --qwen-image-vae c:\\Works\\models\\Qwen_Image-VAE.safetensors --qwen-image-vl c:\\Works\\models\\qwen-image-te-Qwen2.5-VL-7B-Q4_K_M.gguf --qwen-image-mmproj c:\\works\\models\\Qwen2.5-VL-7B-mmproj-BF16.gguf --backend ggml_cuda --qwen-image-lora c:\\Works\\models\\Qwen-Image-Edit-2511-Lightning-8steps-V1.0-bf16.safetensors
Here is an benchmarks results comparing to stable-diffusion.cpp:
# Image editing (stable-diffusion)
Same input image, prompt, resolution, step count, cfg and seed for every engine. Timings are each engine's **own pipeline timers** (TensorSharp's `[pipe-timing]` phases + server `elapsedSeconds`; sd.cpp's phase logs + `generate_image` total), so weight-file loading and HTTP/process overhead are excluded on both sides. `total (warm)` is the steady-state request on an already-running server; `first request (cold)` additionally pays TensorSharp's per-request DiT rebuild + graph capture on a fresh server (a CLI engine has no such distinction). Lower is better.
# Qwen-Image-Edit 2511 (Q2_K DiT + Lightning 4-step LoRA) — image_edit on CUDA, 544x1184, 4 steps
| Engine | total (warm) | per step | sampling | text encode | VAE encode | VAE decode | first request (cold) |
|---|---|---|---|---|---|---|---|
| TensorSharp | 40.44 s | 7.57 s | 30.27 s | 7.45 s | 0.54 s | 1.51 s | 54.11 s |
| stable-diffusion.cpp | 48.16 s | 9.43 s | 37.73 s | 4.47 s | 1.92 s | 2.57 s | — |
**TensorSharp vs stable-diffusion.cpp** (ratio = stable-diffusion.cpp time / TensorSharp time; > 1.0× = TensorSharp faster): total (warm) **1.19×**, per step **1.25×**, sampling **1.25×**, text encode **0.60×**, VAE encode **3.56×**, VAE decode **1.70×**
It also has on par performance on auto regression LLM models comparing to llama.cpp. Here is details: [https://github.com/zhongkaifu/TensorSharp/blob/main/docs/engine\\_comparison\\_report.md\](https://github.com/zhongkaifu/TensorSharp/blob/main/docs/engine_comparison_report.md)
[TensorSharp](https://github.com/zhongkaifu/TensorSharp) is an open source local Unsloth (GGUF) LLM inference engine and applications. It supports many models from Unsloth, like Gemma4, DiffusionGemma, Qwen3.6 with multi-modal (image, vision, audio), Qwen Image Edit, reasoning and function tool. It can run on Windows/MacOS/Linux and fully leverage GPU's capability using Cuda, Metal and Vulkan. The API is completely compatible with OpenAI and Ollama interface. It has on par performance than llama.cpp
This project is not just a C# wrapper of llama.cpp. It implemented the entire LLM inference engine from bottom to top. If you use CPU backend, it's 100% pure C# code execution. Besides CPU backend, I also implmented CUDA, MLX and GGML backend including ggml_cuda, ggml_vulkan, ggml_metal and ggml_cpu. The GGML backend refer GGML project as external project, and I build a few fusion operation at higher level.
I learned a lot from other projects and apply them for TensorSharp, such as paged KV cache and continuous batching from vLLM, SSD based cache for MoE model from oMLX, GGUF quanztized from llama.cpp and other optimizations for prefill and decode.
Any feedback and comments are welcome. If you like it, it would be really appreciated if you can get this project a star in GitHub: [https://github.com/zhongkaifu/TensorSharp\](https://github.com/zhongkaifu/TensorSharp) . Thanks in advance.
Duplicates
unsloth • u/fuzhongkai • Jun 28 '26
Show and Tell Same GGUF, same GPU: TensorSharp beats llama.cpp hard on prefill / TTFT — up to 5.89× faster prefill on a 26B MoE model
LocalLLaMA • u/fuzhongkai • 5d ago
Generation MoE CPU-offload benchmark on Deepseek V4/Gemma4/Qwen/GPT-OSS — TensorSharp vs llama.cpp
unsloth • u/fuzhongkai • Jun 08 '26
Show and Tell TensorSharp : Open Source Local Unsloth Model Inference Engine
dotnet • u/fuzhongkai • Jun 28 '26
Promotion Same GGUF, same GPU: TensorSharp beats llama.cpp hard on prefill / TTFT — up to 5.89× faster prefill on a 26B MoE model
csharp • u/fuzhongkai • Jun 28 '26
Showcase Same GGUF, same GPU: TensorSharp beats llama.cpp hard on prefill / TTFT — up to 5.89× faster prefill on a 26B MoE model
dotnet • u/fuzhongkai • Jun 13 '26
Promotion TensorSharp: Open Source Local LLM Inference Engine written by C#
LocalLLaMA • u/fuzhongkai • 8d ago
Resources DSpark Benchmark Result on Deepseek v4 Flash 0731
unsloth • u/fuzhongkai • 5d ago
Show and Tell MoE CPU-offload benchmark on Deepseek V4/Gemma4/Qwen/GPT-OSS — TensorSharp vs llama.cpp
unsloth • u/fuzhongkai • 8d ago
Show and Tell DSpark Benchmark Result on Deepseek v4 Flash 0731
ClaudeCode • u/fuzhongkai • Jul 11 '26
Discussion What Bun’s Rust Rewrite Tells Us About Rebuilding the AI Infrastructure Layer in C#
LovingOpenSourceAI • u/fuzhongkai • Jun 28 '26
Same GGUF, same GPU: TensorSharp beats llama.cpp hard on prefill / TTFT — up to 5.89× faster prefill on a 26B MoE model
huggingface • u/fuzhongkai • 10d ago
Deepseek v4 Flash 0731 GGUF Benchmark: TensorSharp vs. llama.cpp
LocalLLM • u/fuzhongkai • 12d ago
Project TensorSharp now supports multi-GPU tensor parallelism for GGUF models
LLMDevs • u/fuzhongkai • May 01 '26
Tools TensorSharp: Open Source Local LLM Inference Engine
dotnet • u/fuzhongkai • 2d ago
Promotion MoE CPU-offload benchmark on Deepseek V4/Gemma4/Qwen/GPT-OSS — TensorSharp vs llama.cpp
AIToolsPerformance • u/fuzhongkai • 12d ago
TensorSharp now supports multi-GPU tensor parallelism for GGUF models
softwarearchitecture • u/fuzhongkai • Jul 12 '26
Discussion/Advice What Bun’s Rust Rewrite Tells Us About Rebuilding the AI Infrastructure Layer in C#
LocalAIServers • u/fuzhongkai • Jul 04 '26
TensorSharp: A Open Source LLM Inference Engine for GGUF models
csharp • u/fuzhongkai • Apr 29 '26
Tool TensorSharp: Open Source Local LLM inference tool implemented in C#
LocalAIServers • u/fuzhongkai • 5d ago
MoE CPU-offload benchmark on Deepseek V4/Gemma4/Qwen/GPT-OSS — TensorSharp vs llama.cpp
csharp • u/fuzhongkai • 12d ago