Fuuga.Image
1.0.4
dotnet add package Fuuga.Image --version 1.0.4
NuGet\Install-Package Fuuga.Image -Version 1.0.4
<PackageReference Include="Fuuga.Image" Version="1.0.4" />
<PackageVersion Include="Fuuga.Image" Version="1.0.4" />
<PackageReference Include="Fuuga.Image" />
paket add Fuuga.Image --version 1.0.4
#r "nuget: Fuuga.Image, 1.0.4"
#:package Fuuga.Image@1.0.4
#addin nuget:?package=Fuuga.Image&version=1.0.4
#tool nuget:?package=Fuuga.Image&version=1.0.4
Fuuga.Image
This is image generation MCP client for Fuuga (or other agents) to make the agent capable of producing images via other (Stable Diffusion) models from for example HuggingFace.
Standalone CLI tool for image generation and captioning, built on stable-diffusion.cpp and Phi-3.5-vision.
Commands
fuuga-image txt2img Generate an image from a text prompt
fuuga-image img2img Transform an image guided by a text prompt
fuuga-image caption Generate a text description of an image
fuuga-image info Display model metadata
Quick Start
dotnet build
# Text-to-image
dotnet run -- txt2img --model path/to/model.ckpt --prompt "a cat sitting on a windowsill" --steps 20
# Image-to-image
dotnet run -- img2img --model path/to/model.ckpt --source input.png --prompt "in watercolor style" --strength 0.75
# Caption an image
dotnet run -- caption --model path/to/phi-3.5-vision/ --image photo.jpg --detail standard
# Model info
dotnet run -- info --model path/to/model.ckpt
Common Options
| Option | Description | Default |
|---|---|---|
--model <path> |
Path to model file or directory | (required) |
--output <dir> |
Output directory | output |
--format <fmt> |
Output format: png or jpeg |
png |
--gpu |
Enable GPU acceleration | off |
--verbose |
Enable detailed logging | off |
txt2img Options
| Option | Description | Default |
|---|---|---|
--prompt <text> |
Text description of desired image | (required) |
--negative <text> |
What to avoid in the image | none |
--width <int> |
Image width in pixels (multiple of 8) | 512 |
--height <int> |
Image height in pixels (multiple of 8) | 512 |
--steps <int> |
Denoising steps | 20 |
--cfg <float> |
Classifier-free guidance scale | 7.0 |
--seed <int> |
Random seed (-1 for random) | -1 |
--sampler <name> |
euler, euler_a, heun, dpm2, dpm++2s, lcm |
euler_a |
--batch <int> |
Number of images to generate | 1 |
--vae <path> |
External VAE model | none |
--lora <path> |
LoRA weights | none |
--quantization <q> |
f32, f16, q8_0, q5_1, q4_0 |
f16 |
img2img Options
Same as txt2img, plus:
| Option | Description | Default |
|---|---|---|
--source <path> |
Source image to transform | (required) |
--strength <float> |
Denoising strength 0.0-1.0 | 0.75 |
caption Options
| Option | Description | Default |
|---|---|---|
--image <path> |
Image to caption | (required) |
--detail <level> |
brief, standard, detailed |
standard |
--max-tokens <int> |
Maximum tokens to generate | 256 |
--prompt <text> |
Custom prompt (must contain <\|image_1\|>) |
none |
MCP Server Mode
Fuuga.Image can run as an MCP tool server over stdio, enabling integration with Fuuga LLM via the MCP protocol:
dotnet run -- --mcp-server
This exposes three tools via JSON-RPC 2.0 over stdin/stdout:
fuuga_image_txt2img-- text-to-image generationfuuga_image_img2img-- image-to-image transformationfuuga_image_caption-- image captioning
See architecture.md Section 18 for the full integration design.
F# Script Demo
An interactive demo script shows how to use Fuuga.Image as an F# library — calling the modules directly with record-based configuration, validation, and I/O:
dotnet build Fuuga.Image
dotnet fsi examples/image-demo.fsx
The script runs without models (dry-run mode), exercising types, validation, image I/O, and prompt templates. Uncomment Section 5 and set your model paths for actual generation. See examples/image-demo.fsx for the full source.
Project Structure
Fuuga.Image/
Types.fs Layer 0: Domain types, error handling (ImageError DU)
Config.fs Layer 1: CLI argument parsing
ImageIO.fs Layer 2: Image load/save, format conversion, validation
Diffusion.fs Layer 3: Stable Diffusion model wrapper (txt2img, img2img)
Caption.fs Layer 4: Phi-3.5-vision captioning (ONNX Runtime GenAI)
McpServer.fs Layer 5: MCP JSON-RPC 2.0 server over stdio
Program.fs Layer 6: Entry point, subcommand routing, error handling
Architecture
- Image Extension Architecture -- standalone design
- Main Architecture Section 18 -- Fuuga LLM integration
| 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
- FSharp.Core (>= 10.1.201)
- HPPH.SkiaSharp (>= 1.0.0)
- Microsoft.ML.OnnxRuntimeGenAI (>= 0.12.2)
- StableDiffusion.NET (>= 6.0.0)
- StableDiffusion.NET.Backend.Cpu (>= 6.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.