Skip to content

Finalize 0.1.0: notices, About page, GPU VAE decode, UX fixes - #38

Merged
bpacholek merged 48 commits into
mainfrom
feat/foundation
Jul 7, 2026
Merged

bpacholek merged 48 commits into
mainfrom
feat/foundation

Conversation

@bpacholek

Copy link
Copy Markdown
Contributor

Brings Gentastic to a releasable 0.1.0 state: a local, no-Python Windows app for running FLUX and SDXL image models on your own GPU (Vulkan / CUDA / CPU).

Highlights

  • GPU VAE decode. Vulkan and CUDA now decode the VAE on the GPU via conv-direct (about 8x faster at 1024, and it fixes the old "engine returned no image" out-of-memory on Vulkan). Escape hatches: GENTASTIC_VAE_CPU, GENTASTIC_VAE_NO_CONV_DIRECT.
  • Memory guidance. Each model shows an approximate GPU-memory need in the picker, with a warning when it likely will not fit the detected GPU. Friendlier out-of-memory messages plus app-wide crash logging.
  • Licensing. New THIRD_PARTY_NOTICE.md and licenses/ (MIT, Apache-2.0, LGPL-2.1, SIL OFL 1.1, CC BY 4.0, BSD-3-Clause), bundled into the portable zip so the redistribution meets its attribution obligations. All bundled components are compatible with the app's BSD-3-Clause license.
  • About page with open-source acknowledgements and a third-party licenses button.
  • Content gating: an age gate plus a per-generation acknowledgement for adult and real-face models.
  • Settings clarity: restart messages now say "the app" (not an ambiguous system reboot), and the "Show adult models" toggle applies live on save instead of after a restart.
  • Docs: AGENTS.md, CLAUDE.md, HUMANS.md handoff guides, plus the Jekyll landing site under website/ and its Pages workflow.

Testing

  • dotnet build Gentastic.slnx -c Release clean, dotnet test green (53 tests).
  • GPU VAE decode, model-memory hints, live adult-model toggle, and the CUDA runtime messaging verified end-to-end on an AMD Radeon 8060S (Vulkan). CUDA follows the same code path, pending real NVIDIA hardware.

🤖 Generated with Claude Code

bpacholek and others added 30 commits July 4, 2026 23:01
…HF downloader

Foundation (milestone M0) for a modern, no-Python FLUX image-generation app.

- 5-project .NET 10 solution: App (WPF + WPF-UI Fluent, MVVM), Core (domain +
  service interfaces + orchestration), Engine (StableDiffusion.NET/Vulkan wrapper),
  Hardware (DXGI runtime detection), Models (catalog + Hugging Face downloader).
- Real, verified pieces: runtime detector (identifies AMD Radeon 8060S -> Vulkan),
  FLUX schnell/dev GGUF catalog with companion encoders/VAE, streaming HF downloader
  with cache, WPF-UI shell (Generate/Models/Settings) that boots cleanly.
- Engine wrapped behind IDiffusionEngine; native generate call is stubbed for M1.
- xUnit tests (5) green; GitHub Actions CI (build+test on windows-latest/.NET 10).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the engine stub with a real StableDiffusion.NET (stable-diffusion.cpp)
implementation:
- Load FLUX from resolved GGUF + CLIP-L + T5-XXL + VAE paths; force the detected
  backend (Vulkan on AMD), tiled VAE decode to guard the Strix Halo VAE OOM.
- Text-to-image and image-to-image sampling on a background thread, with the
  native progress callback forwarded to IProgress and RGB pixels copied out to
  the backend-agnostic RenderedImage.
- IsAvailable now reflects a present native backend, so the UI runs the real
  download -> load -> generate flow.

Also fix the catalog to city96's actual GGUF names (Q4_K_S, not Q4_K_M) and
extend the Quantization enum accordingly.

Build + 5 tests green. Runtime verification on the 8060S pending model download.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
black-forest-labs/FLUX.1-schnell is gated (gated=auto) and 401s without an HF
token, so the "schnell needs no token" flow broke on the VAE download. Use
Comfy-Org's ungated ae.safetensors (byte-identical, 335,304,388 B) instead.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
tools/Gentastic.Smoke resolves the cached FLUX model, loads it on the detected
backend, generates one 512x512 image and saves a PNG, returning non-zero if the
output is near-uniform. Doubles as the M0 Vulkan smoke test and the runtime
verification harness for the engine.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
StableDiffusion.NET loads its native library once, lazily, on the first native
call and caches it for the process. The engine enabled Vulkan inside
LoadModelAsync, but the constructor's InitializeEvents() already triggered the
load with only the default CPU backend active — so every generation ran on the
CPU (266s for 512^2/4-step, ~24 cores pegged).

- Select the backend in the constructor, before InitializeEvents (the first
  native call). Detector is injected to decide Vulkan vs CPU.
- Keep CPU enabled as a fallback; Vulkan's higher priority wins when present.
- Drop the diagnostic GetSystemInfo() call: its binding frees a native static
  string and corrupts the heap (STATUS_HEAP_CORRUPTION, 0xC0000374).

Verified on the 8060S: loads on Vulkan0 (AMD Radeon 8060S), load 10.7s,
generation 21.5s — ~12x faster, correct image. Note: switching backend now
requires an app restart (native lib is process-global).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Resume interrupted downloads: if a .part file exists, request Range: bytes=N-
  and append when the server returns 206 (restart on 200). Progress and total
  account for the already-fetched bytes.
- Verify a completed download against ModelFile.Sha256 when present; delete the
  corrupt .part and throw on mismatch. New Checksum utility (Sha256Async/VerifyAsync).
- Tests for the checksum helper (known vector, case-insensitive match, mismatch).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- New Gentastic.Core PngMetadata: injects/reads iTXt (UTF-8) chunks by direct
  byte manipulation with correct CRC-32 (WPF's PNG metadata writing is
  unreliable). Unit-tested (UTF-8 round-trip, insert-before-IEND, non-PNG throws).
- RenderedImageExtensions.SavePng gains an optional metadata parameter.
- GenerateViewModel auto-saves each result to Pictures/Gentastic as
  gentastic_<timestamp>_<seed>.png embedding prompt, negative, model, seed,
  steps, cfg, sampler and size; adds an "Open output folder" command/button.

Verified end-to-end: a real Vulkan-generated PNG carries the iTXt metadata
(prompt/model/software) and still decodes as a valid 512x512 image. 11/11 tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The smoke tool now runs the full download -> load -> sample pipeline via
GenerationService (the same path the app uses) instead of calling the engine
directly, reporting each GenerationStage. Verified on the 8060S: stages
Downloading (cached) -> LoadingModel -> Sampling 0..4 -> Done, valid image on Vulkan.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The negative prompt only takes effect with CFG > 1 on guidance-distilled FLUX, so
the input is now disabled (with the existing explanatory hint) until CFG is raised,
instead of silently accepting text that does nothing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
#16)

- New JSON settings layer in Core (AppSettings, ISettingsService,
  JsonSettingsService at %LOCALAPPDATA%/Gentastic/settings.json) with tests.
- #15: HF token stored in settings and used by the downloader (falling back to
  HF_TOKEN); gated repos now throw a clear "accept license + set token" error
  instead of a bare 401. Settings page has a token field.
- #13: PreferredBackend (Auto/Vulkan/CPU) persisted and applied at engine init
  (native backend is process-global, so changes take effect on restart). Settings
  page has a backend picker.
- #16: Models page shows total cache disk usage; Settings shows cache size + open
  folder. (list/delete already present.)

14/14 tests; app boots cleanly with the new DI graph.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…25)

- Generate page gains an "Use an input image" toggle (#25) that reveals an input
  panel (#23): a drop zone (drag & drop), Browse/Clear, an image preview, and a
  denoise-strength slider. BuildRequest branches to ImageToImageRequest.
- RenderedImageExtensions.LoadRenderedImage decodes any file to packed RGB.
- Saved metadata records mode=img2img + denoise_strength.
- Verified the engine i2i path (#22) and GenerationService i2i wiring (#24) via the
  smoke tool (env GENTASTIC_I2I=1): reusing a t2i result as the init image with
  strength 0.6 produced a correct transformed image on Vulkan.

App boots clean; 14/14 tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- #28: determinate progress bar bound to GenerationStatus.Fraction and a Cancel
  button (enabled while busy). GenerateAsync now runs under a CancellationToken;
  cancellation is honored before/between stages and during download (the native
  sampling call can't be interrupted mid-step, surfaced as a limitation).
- #29: Settings gains a cache-folder override (with a folder picker) alongside the
  existing HF token and backend controls; wired into HuggingFaceOptions.CacheRoot
  (applies on restart, like the backend).

App boots clean; build green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
New Gallery page (nav item) that lists previously generated images from
Pictures/Gentastic as thumbnails (decoded small for low memory), with a detail
pane showing the full image and its embedded PNG metadata read back via
PngMetadata.ReadTextChunks, plus Refresh / Open-folder / Delete. Registered in DI.

Boot-verified (page + DI graph load clean; window renders with the Fluent theme).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- #27: named presets (prompt, negative, model, size, steps, seed, cfg, sampler)
  persisted to presets.json via a new Core IPresetStore/JsonPresetStore (tested).
  Generate page gains a preset picker + name box with Save/Delete; selecting a
  preset applies all its parameters (adding a custom size entry when needed).
- #30: the engine already decodes the VAE tiled (guards Strix Halo VAE OOM); the
  Generate flow now detects out-of-memory failures and suggests a smaller size,
  fewer steps, or a lower-quant model.

16/16 tests; app boots clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Theme preference is persisted in settings, applied at startup via WPF-UI's
ApplicationThemeManager (System follows the OS), and changeable live from the new
Settings > Appearance section. Verified: switching to Light flips the window
background from dark to light.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Rewrite the README for the now feature-complete app: feature list, usage guide
(Models/Generate/Gallery/Settings), model/license notes, and two real sample
images generated on the 8060S (a text-to-image result and its image-to-image
transform) under docs/images/.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The StableDiffusion.NET backend packages already bundle the native libraries
(runtimes/win-x64/native/{vulkan,cpu,avx*}). Add a startup runtime check that
warns (once, via a dialog) when no GPU is detected so users aren't surprised by
very slow CPU generation; silent when a GPU is present.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
#32 — a self-contained, portable Windows build (no .NET install needed):
- scripts/publish-portable.ps1 publishes -r win-x64 --self-contained and zips it.
- A RID publish flattens/dedupes the StableDiffusion.NET native backends (all named
  stable-diffusion.dll under runtimes/win-x64/native/<variant>/), so the script
  reconstructs that tree from the NuGet packages — verified all four backends incl.
  the 76MB Vulkan DLL land correctly and the portable exe boots.
- .github/workflows/release.yml builds the zip and publishes a GitHub Release on a
  v* tag; dist/ is gitignored; app Version set to 0.1.0.

#34 — GitHub Releases update check: Core IUpdateService + Models GitHubUpdateService
(queries releases/latest, compares the tag to the running version; tested version
parsing + comparison). Settings > Updates has a "Check for updates" button, status,
and a link to the releases page.

24/24 tests; app boots clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…wesome

- Replace the stock WPF-UI NavigationView with a custom dark, branded sidebar
  (stays dark in both themes) driving a content Frame: brand header, WORKSPACE
  section, nav rows with Font Awesome icons, accent-tinted active state + left bar,
  Settings pinned at the bottom.
- New Theme/Design.xaml design system: brand accent (#6366F1), sidebar palette,
  a NavItem style, a compact accent PrimaryButton style, and a field-label style.
- Add FontAwesome.Sharp (FA6) for iconography.
- Add an env-gated screenshot mode (RenderTargetBitmap self-capture + software
  render) so the UI can be verified headlessly despite Mica/GPU compositing.

Verified via captured screenshots (Generate + Settings) and a normal Mica boot.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Replace the full-width Generate button with a compact accent PrimaryButton (Font
  Awesome wand icon) in a pinned action bar at the bottom of the controls column,
  so the primary action is always visible while the fields scroll above (divider
  between). Cancel + open-output become compact icon buttons beside it.
- Add a Font Awesome icon to the page header; widen the controls column so the
  preset Delete/Save buttons no longer clip.

Verified via screenshot.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ion)

- Design system: add a compact SecondaryButtonStyle (subtle fill + border).
- Models: Font Awesome header/row icons, accent icon tiles per model, green/muted
  status dots, and compact accent Download + secondary Delete buttons (replacing
  the off-brand default-blue primary buttons).
- Gallery: replace the jarring default-blue thumbnail selection with a subtle
  accent ring on rounded, clipped thumbnails; icon header/detail buttons.

Verified via screenshots.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Font Awesome icon on the header and each card (Runtime/Appearance/Model cache/
Hugging Face/Updates), FieldLabelStyle sub-labels, an accent Save button and
consistent SecondaryButton actions (Browse/Open cache/Check for updates).

Verified via screenshot.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Apply the shared FieldLabelStyle (small, semibold, muted) to the Generate page's
field labels so they match the Settings panel — cleaner, more consistent form.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Preset Delete/Save and image-to-image Browse/Clear now use the shared
  Secondary button style with Font Awesome icons (compact, on-brand, unclipped).
- Add icons to the empty states: an upload glyph in the drag-and-drop zone and a
  large image glyph in the preview placeholder.

Verified via screenshot.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
FLUX generation crashed after the sampler finished with "The engine
returned no image." (InvalidOperationException). Root cause: at 1024²
(the app default size) the VAE decode needs a single ~8 GB compute
buffer, but the AMD Vulkan driver on Strix Halo caps one buffer at
~2 GB (maxStorageBufferRange). It fails with ErrorOutOfDeviceMemory
*after* sampling — so GenerateImage returns null (sd.cpp #1290).
WithVaeTiling() doesn't help: ggml reserves the full-resolution decode
graph up front regardless.

Fix: enable WithVaeOnCpu() when the backend is Vulkan, so VAE decode
runs in system RAM (no per-buffer limit) while the diffusion transformer
— the expensive part — stays on the GPU. CPU/CUDA/ROCm keep VAE
on-device where the allocation succeeds. Verified end-to-end: 1024²
schnell now produces a correct image (decode buffer moves to 6.7 GB RAM).

Also: the smoke tool takes GENTASTIC_W/H/STEPS/CFG env overrides so it
can reproduce the app's real 1024² defaults, not just the 512² fast path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the hardcoded "any GPU → Vulkan" recommendation with a real
priority probe. For each backend the detector now reports whether it is
Ready / NeedsSetup / NotApplicable, based on three cheap, side-effect-free
signals: matching GPU hardware (DXGI vendor), whether the native library
is bundled, and whether the runtime/SDK is installed (delegated to
StableDiffusion.NET's Backends.*.IsAvailable — CUDA_PATH, the AMD HIP
SDK's HIP_PATH, etc.; no native library is loaded, so detection stays
safe to run before the engine pins a backend).

- BackendProbe / BackendAvailability model; HardwareProfile carries the
  full probe list + ProbeFor(backend).
- IBackendInspector seam → StableDiffusionBackendInspector (real) keeps
  the selection logic pure and unit-testable (BuildProbes/Recommend).
- BackendPreference gains Cuda/Rocm; the engine honours a forced backend
  only when its probe is Ready, else falls back to the recommendation.
- 7 new tests cover the priority scenarios (AMD→Vulkan, NVIDIA+CUDA→CUDA,
  AMD+ROCm→ROCm over Vulkan, runtime-present-but-not-bundled fallbacks,
  no-GPU→CPU). Verified on the real 8060S: Vulkan Ready, ROCm NeedsSetup,
  CUDA NotApplicable, CPU Ready.

Groundwork for the startup runtime-detection dialog. Adds AppSettings
.RuntimeConfirmed (first-run gate) and a GENTASTIC_DETECT_ONLY fast path
+ per-backend probe printout in the smoke tool.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
On first launch Gentastic now shows a dialog that reports the detected
hardware and the CUDA → ROCm → Vulkan → CPU probe results, with a status
icon per backend (ready / needs-setup / not-applicable) and each one's
reason. "Automatic" is preselected (defers to detection each launch);
ready backends can be chosen to override, non-ready ones are shown but
disabled for transparency. The choice is persisted and RuntimeConfirmed
keeps it to a first-run event; the backend is still changeable in Settings.

Replaces the old no-GPU MessageBox warning (RuntimeCheck), which is
superseded by the dialog's CPU-fallback row. Wired in App startup before
the engine resolves, so a first-run override takes effect immediately.
Includes a GENTASTIC_SHOT_RUNTIME self-capture path (verified on the real
8060S: Automatic→Vulkan, CUDA not-applicable, ROCm needs-setup).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Settings' Runtime card now shows the same CUDA → ROCm → Vulkan → CPU
probe table as the first-run dialog (status icon + reason per backend),
and a "Re-detect…" button reopens the dialog to re-run detection and
change the runtime. Extracted RuntimeDialogViewModel.BackendRows so the
dialog and Settings render identical rows; dropped the now-redundant
"Detected adapters" list. Wired a Func<RuntimeDialog> factory in DI.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add per-status elapsed/delta timing to the smoke tool. Used it to
diagnose the slow FLUX sampling:

- Steps are uniform (~6s/step at 512², ~60s/step at 1024²) with no
  first-step spike, so it is NOT cold-start Vulkan shader compilation.
- Flash attention is perf-neutral (A/B: 47.9s vs 47.2s for 8 steps) —
  kept on for bounded attention memory.
- CPU VAE decode (via the earlier WithVaeOnCpu fix) is ~2x faster than
  the GPU Vulkan decode here (12.9s vs 29.9s at 512²) — a bonus win.

Root cause is a known gfx1151 limitation: the Windows AMD Vulkan driver
(AMDVLK) exposes only 32 KB shared memory vs RADV's 65 KB, capping
compute throughput (AMDVLK #420). The RADV workaround is Linux-only, so
there's no Windows code-side fix; faster paths are Linux+RADV or ROCm.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
More icons, less text, more straightforward:
- Generate page field labels now carry small muted glyphs (Prompt/pen,
  Negative/ban, Model/cube, Size/expand, Steps/layers, CFG/sliders,
  Seed/dice, Sampler/curve) for a scannable property-row look.
- Trimmed wordy copy: "Use an input image (image-to-image)" → "Image to
  image", "Denoise strength (higher = more change)" → "Denoise strength"
  (+tooltips), negative-prompt hint shortened, "Seed (-1 = random)" →
  "Seed" (+tooltip).
- Models page: dropped the paragraph subtitle, centered the title.
- Settings: "CACHE FOLDER OVERRIDE (BLANK = DEFAULT; APPLIES AFTER
  RESTART)" → "CACHE FOLDER" (+tooltip).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
bpacholek and others added 18 commits July 5, 2026 14:50
Adds ModelSpec.IsAdult and an AppSettings.ShowAdultModels toggle (off by
default). Adult-flagged models are hidden from the Generate picker and
the model manager unless the user opts in via a new Settings → Content
card ("Show adult models (18+)"). Only legal, mainstream open models.

First entry: FLUX.1 Modern Anime (alfredplpl/flux.1-dev-modern-anime-gguf,
modern-anime_Q4_0.gguf) — a standard FLUX.1-dev finetune, so it reuses
the existing CLIP-L / T5 / VAE companions with no engine changes. It's a
community re-host that downloads ungated, so the catalog test now asserts
the real license invariants (schnell never gated; the official dev base
models gated) rather than "every dev-kind model is gated". Verified:
hidden by default, visible when enabled. 32 tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The engine's model loading is now architecture-aware: FLUX.1 keeps its
CLIP-L + T5-XXL encoders, while FLUX.2 klein wires a single Qwen3 LLM
encoder (WithLLMPath) instead — sd.cpp auto-detects the transformer
architecture from the diffusion model, so only the encoder path changes.

Adds ModelKind.Flux2Klein, ModelFileRole.TextEncoderLlm, and the catalog
entry (all ungated re-hosts, ~5 GB total — smaller than FLUX.1):
  diffusion: leejet/FLUX.2-klein-4B-GGUF / flux-2-klein-4b-Q4_0.gguf
  encoder:   unsloth/Qwen3-4B-GGUF / Qwen3-4B-Q4_K_M.gguf
  vae:       Comfy-Org/flux2-dev / split_files/vae/flux2-vae.safetensors
klein is distilled (cfg 1.0, 4 steps), so IsGuidanceDistilled includes it.

Builds clean; FLUX.1 path unchanged; 32 tests pass (catalog file-set test
is now architecture-aware). End-to-end generation still to be verified on
the real GPU (needs the ~5 GB download).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The smoke tool assumed the model was already cached and returned exit 3
if not. GenerationService.RunAsync already downloads missing files, so
let it — needed to verify new models (e.g. FLUX.2 klein) end-to-end.
GENTASTIC_REQUIRE_CACHED=1 restores the old fail-fast behaviour.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
End-to-end verified on the real 8060S: klein-4B downloads (all ungated),
loads via the architecture-aware engine (Qwen3 LLM encoder + FLUX.2 VAE,
sd.cpp reports "Flux2 FLOW mode"), and renders a clean 512² image in ~18s
— ~1.8 s/step vs FLUX.1's ~6 s/step, and ~6 GB vs 16 GB. It's the fastest
model on this hardware, so the picker label now reads "FLUX.2 klein 4B
(fast)".

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
FLUX.2 klein's content filter lives in its Qwen3 text encoder, so the
community fix is an "ablated" Qwen3-4B encoder swapped in under the stock
klein diffusion — a clean drop-in for our architecture-aware engine (only
the LLM-encoder file changes). New adult entry "FLUX.2 klein — Uncensored
(fast, realistic)": klein diffusion + Cordux/flux2-klein-4B-uncensored-
text-encoder (qwen3-4b-abl-q4_0.gguf) + FLUX.2 VAE. Inherits klein's ~18s
speed and photorealism; handles anime via prompting. Hidden behind the
existing adult gate. 32 tests pass.

Also DRY'd the shared klein diffusion file. Dedicated FLUX.2 *anime* NSFW
finetunes don't exist yet — noted SDXL as the anime route in a comment.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Verification revealed the Cordux ablated-encoder repo is age-gated on HF
(confirmed: 401 without a token). Corrected the license to Gated: true so
the app surfaces the "(gated)" badge and the download prompts for a token
+ license acceptance — the same flow FLUX.1-dev already uses. The engine
path is unchanged (the verified klein path), so it generates once a token
is set in Settings.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Extends the architecture-aware engine to a third family, SDXL, which
loads from a single all-in-one checkpoint (UNet + CLIP-L/G + VAE) via
WithModelPath — simpler than FLUX (no separate encoders). Generation uses
WithSDXLDefaults instead of WithFluxDefaults (threaded the model kind into
BuildParameter). SDXL isn't guidance-distilled, so negative prompts work
at normal CFG (IsGuidanceDistilled already returns false for it).

Adds ModelKind.Sdxl, ModelFileRole.Checkpoint, and a dedicated anime NSFW
model: Illustrious XL (OnomaAIResearch/Illustrious-xl-early-release-v0,
Illustrious-XL-v0.1.safetensors — single ungated 6.9 GB checkpoint, the
SDXL anime gold standard), behind the adult gate. Defaults: 28 steps,
CFG 6. Builds clean; FLUX.1/FLUX.2 paths unchanged; 32 tests pass (catalog
file-set test now handles the single-checkpoint SDXL shape). Generation
verification (download + render) running next.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
End-to-end verified on the 8060S: Illustrious loads (Version: SDXL, single
checkpoint, CLIP-L/G baked in), VAE decodes on CPU (7.7 GB buffer — over
the Vulkan cap, so on-CPU is essential), and renders a clean, correctly-
coloured 1024² image (the SDXL conv-scale VAE fallback is fine). SDXL is
the slow-but-capable option here (~10.5 s/step), so the default drops from
28 to 24 steps to trim ~40 s without hurting quality.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Rounds out the SDXL family with a photorealistic option: RealVisXL V5.0
(SG161222/RealVisXL_V5.0, RealVisXL_V5.0_fp16.safetensors — single-file,
ungated, 6.9 GB). Pure catalog add — reuses the SDXL engine path already
verified with Illustrious. Behind the adult gate; defaults 25 steps / CFG 5.
Adult lineup is now realistic (FLUX.2 uncensored / RealVisXL) + anime
(Illustrious / FLUX.1). 32 tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Reordered the catalog so FLUX.2 klein 4B is first — it's the verified best
option on this hardware (fastest at ~1.8 s/step, smallest at ~5 GB,
highest quality), so it's now the default in the Generate picker and leads
the Models list. FLUX.1 schnell/dev remain available. Verified via
screenshot: Generate defaults to "FLUX.2 klein 4B (fast)". 32 tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
New "Images" control (1–4) on the Generate page. GenerateAsync now loops
that many times, varying the seed per image — a fixed seed stays
reproducible (seed + i) while -1 randomises each — and shows batch-aware
progress ("[2/4] Sampling step …"). Each image saves to the output folder
and appears in the Gallery; the preview updates as each completes. A
classic out-of-box feature, and cheap now that FLUX.2 klein (~18 s) is
the default. Builds clean; 32 tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Gated models (FLUX.1-dev, the FLUX.2 uncensored encoder, etc.) now show a
"Get access" button in the model manager that opens the model's Hugging
Face page in the default browser, so the user can accept the license /
request access — then add a token in Settings and download. Non-gated
models don't show it (ModelRowViewModel.IsGated = License.Gated + a URL).
The status line then guides them through the accept → token → download
flow. Verified via screenshot; 32 tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Review of the recent batch feature found a real bug: a batch with a random
seed (-1) names every file "…_rnd.png", so images finishing in the same
second would overwrite each other. SaveOutput now appends _2/_3… when a
name already exists.

Added a headless auto-generate test hook (GENTASTIC_AUTOGEN, env-gated
like the screenshot hooks) that drives a real batch through the actual
GenerateViewModel. Used it to verify end-to-end: a 2-image klein batch
produced exactly 2 uniquely-named, visually-distinct images with the
correct "Generated 2 images" status. App startup skips the runtime dialog
under AUTOGEN too.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The managed side already handled CUDA (runtime detector probe, engine
SelectBackend, the runtime dialog, BackendPreference.Cuda) — it only
needed the native backend bundled. Rather than bloat every download with
the ~200 MB NVIDIA-only CUDA library, it's an opt-in variant:

- Gentastic.App.csproj references StableDiffusion.NET.Backend.Cuda12.Windows
  only when -p:IncludeCuda=true, so the default (AMD/CPU) build stays lean.
- publish-portable.ps1 gains -IncludeCuda, producing a separate
  "-cuda" zip that also reconstructs the cuda12 native folder.
- release.yml builds and attaches both the default and the CUDA zip.

The detector auto-lights CUDA up (native folder "cuda12") when an NVIDIA
GPU + CUDA 12 toolkit are present. Verified: default zip 131 MB (no CUDA);
CUDA zip 308 MB with the 201 MB cuda12 backend bundled, boots cleanly.
Actual CUDA generation is untested here (no NVIDIA GPU).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Per request, the shipped build is now universal: one download works on
AMD/Intel (Vulkan), NVIDIA (CUDA), and CPU — the detector auto-selects.
publish-portable.ps1 always passes -p:IncludeCuda=true and reconstructs
the cuda12 native, producing a single Gentastic-portable-win-x64.zip
(~309 MB) instead of separate variants; release.yml ships that one zip.

CUDA stays gated behind IncludeCuda in the csproj purely so normal dev/CI
builds don't restore the ~200 MB native — it's always on for releases.

Card support (CUDA arch 61;75;86;89;100): RTX 2070 and the whole 20-series
work (Turing / compute 7.5), as do GTX 10-series (Pascal) through RTX
50-series (Blackwell). Verified the universal zip bundles cuda12 + vulkan
+ cpu and the dev build stays CUDA-free.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The bundled CUDA backend native dynamically links cudart + cuBLAS, which
normally come from the CUDA Toolkit. Rather than force a ~550 MB base
download or a toolkit install, CudaRuntime downloads NVIDIA's official
redistributables on demand into %LOCALAPPDATA%\Gentastic\cuda-runtime,
writes a version.json so StableDiffusion.NET's CudaBackend detects CUDA
12, and at startup points CUDA_PATH + the DLL search path at it (unless a
real toolkit is already installed). The NVIDIA driver supplies nvcuda.dll,
so nothing else is needed.

Settings shows a "Download CUDA runtime (~540 MB)" button with progress
when an NVIDIA GPU is present but CUDA isn't ready; it self-hides
otherwise. Uses CUDA 12.8 redist (cuda_cudart 12.8.90 + libcublas
12.8.4.1) matching the native's build.

Verified: builds, 32 tests pass, Settings renders (section hidden on this
AMD box), redist URLs 200, archive layout matches the extractor,
version.json format matches the library's parser. Actual CUDA generation
+ the NVIDIA-only download button are untested (no NVIDIA GPU here).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Brings the app to a releasable 0.1.0 state.

- Docs: add AGENTS.md, CLAUDE.md, HUMANS.md handoff guides.
- Licensing: add THIRD_PARTY_NOTICE.md and licenses/ (MIT, Apache-2.0,
  LGPL-2.1, SIL OFL 1.1, CC BY 4.0, BSD-3-Clause); bundle them in the
  portable zip so the redistribution meets its attribution obligations.
- Engine: decode the VAE on the GPU via conv-direct on Vulkan and CUDA
  (about 8x faster at 1024), with GENTASTIC_VAE_CPU / _NO_CONV_DIRECT
  escape hatches.
- Models: per-model GPU-memory estimates in the picker plus a "may not
  fit your GPU" warning; friendlier out-of-memory messages and app-wide
  crash logging.
- About page: open-source acknowledgements and a third-party licenses
  button.
- Content gating: age gate plus a per-generation acknowledgement for
  adult and real-face models.
- Settings: clarify restart messaging (app, not system) and apply the
  "Show adult models" toggle live on save instead of after a restart.
- Website: add the Jekyll landing site and its Pages workflow.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Detect_ReturnsInternallyConsistentProfile hardcoded RecommendedBackend
== Vulkan whenever any adapter was present, which only holds on a
Vulkan-capable dev machine. CI's headless runner enumerates a GPU
adapter but has no Vulkan runtime, so it correctly recommends CPU and
the test failed. Assert the real invariant instead: the recommendation
is the highest-priority Ready probe (or CPU fallback), matches a probed
backend, and implies a detected adapter only for GPU backends.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bpacholek
bpacholek merged commit 2d25c7f into main Jul 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant