ImagePromptGenerator 0.5.2
dotnet add package ImagePromptGenerator --version 0.5.2
NuGet\Install-Package ImagePromptGenerator -Version 0.5.2
<PackageReference Include="ImagePromptGenerator" Version="0.5.2" />
<PackageVersion Include="ImagePromptGenerator" Version="0.5.2" />
<PackageReference Include="ImagePromptGenerator" />
paket add ImagePromptGenerator --version 0.5.2
#r "nuget: ImagePromptGenerator, 0.5.2"
#:package ImagePromptGenerator@0.5.2
#addin nuget:?package=ImagePromptGenerator&version=0.5.2
#tool nuget:?package=ImagePromptGenerator&version=0.5.2
ImagePromptGenerator
A lightweight, fluent C# library for building AI image generation prompts.
This library provides a small set of strongly-typed helper classes and helpers for composing style anchors, negative keywords, and full image generation prompts suitable for use with image generation models or pipelines.
Key features
- Friendly API for building image prompts using
StyleAnchor,StylePrompt,NegativeKeyword,NegativePrompt, andImageGenerationPrompt. - Predefined style anchors covering common categories: sticker, photography, 2D art, 3D rendering, traditional art, and general/abstract.
- Built-in negative keywords to exclude artifacts and style clashes (e.g.,
bad hands,watermark,realistic). - Preset prompt factories for common use-cases: sticker, 3D icon, photorealistic, and pixel art.
- Simple string conversion with a default negative postfix
--nosuitable for many model CLI interfaces.
Quick start
Install or add this project to your solution. The source is minimal and can be referenced directly.
Build and pack the NuGet package (optional):
dotnet pack -o ./nupkgs ImagePromptGenerator.cs
dotnet nuget push ./nupkgs/ImagePromptGenerator.[version].nupkg --api-key $API_KEY --source https://api.nuget.org/v3/index.json
Basic usage
The library uses fluent operators to combine styles and negative keywords.
// Create a style prompt by combining predefined anchors
var style = StyleAnchor.Sticker.Cute
+ StyleAnchor.Sticker.Emoji
+ StyleAnchor.Art2D.CelShaded
+ StyleAnchor.Art2D.VibrantFlatColors;
// Build negative keywords to avoid certain styles and elements
var negative = NegativeKeyword.StyleClash.Photorealistic
+ NegativeKeyword.Elements.Text
+ NegativeKeyword.Elements.Watermark;
// Construct the final prompt
var prompt = new ImageGenerationPrompt(style, "smiling cat with party hat", negative);
// Customize background or subject if needed
prompt.Background = "isolated on a transparent background";
// Convert to string (uses default postfix "--no" for negative prompt)
Console.WriteLine(prompt.ToString());
Output example:
(cute sticker illustration, custom emoji, cel-shaded, vibrant flat colors), smiling cat with party hat, isolated on a transparent background --no (photorealistic, text, watermark)
Preset prompts
The library includes factory methods that return ready-to-use presets:
ImageGenerationPrompt.PresetSticker()— optimized for sticker/emoji icons.ImageGenerationPrompt.Preset3DIcon()— for glossy 3D icon renders.ImageGenerationPrompt.PresetPhotorealistic()— for photorealistic images.ImageGenerationPrompt.PresetPixelArt()— for pixel-art / 8-bit style images.
Use them as starting points and then adjust Subject or Background:
var sticker = ImageGenerationPrompt.PresetSticker();
sticker.Subject = "red panda mascot holding a balloon";
Console.WriteLine(sticker);
API Summary
StyleAnchor— Defines a single style description; implicitly convertible fromstringand combines intoStylePromptwith+.StylePrompt— A collection ofStyleAnchorprovidingToString()formatting and convenient operators to combine with anchors, strings, or other prompts.NegativeKeyword— Single negative keyword; implicitly convertible fromstringand combines intoNegativePromptwith+.NegativePrompt— A collection ofNegativeKeywordandToString()implementation to produce a negative list.ImageGenerationPrompt— The final model of the prompt containingStyle,Negative,Subject, andBackground. It provides aToString()that uses--no(default) as a negative postfix, and an overloadedToString(string)to override the postfix.
Combining prompts
Style anchors and negative keywords support + operator for fluent composition. Examples:
var combined = StyleAnchor.Photography.Cinematic + StyleAnchor.Photography.GoldenHour;
var bad = NegativeKeyword.Quality.Blurry + NegativeKeyword.Elements.Text;
These can be passed directly into ImageGenerationPrompt.
Conventions & defaults
ImageGenerationPrompt.Backgrounddefaults to:isolated on a plain white background.DefaultNegativePromptPostfixdefaults to--no— a widely used negative postfix in model CLI style interfaces.
Contributing
Contributions, improvements, new anchors or keywords, and bug reports are welcome. Please fork this repository and open a PR.
License
This project uses the MIT license (see PackageLicenseExpression in project metadata).
If you'd like, I can also add usage examples for specific models (e.g., how to pass these prompts to a Python client or an HTTP API for image generation) — tell me which backend or model you target and I'll add examples.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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 was computed. 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. |
-
net6.0
- No dependencies.
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.5.2 | 342 | 11/17/2025 |