Skip to content

Instantly share code, notes, and snippets.

View FNGarvin's full-sized avatar

Fred N. Garvin FNGarvin

  • Moline, IL
View GitHub Profile
@FNGarvin
FNGarvin / Nunchaku_HOWTO.md
Created May 20, 2026 16:51
Working Nunchaku Build Steps

If you don't have the required cuda dev kit already, installing it is a pita in itself (assuming apt-based os and cu13 target, adjust as necessary):

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb
dpkg -i cuda-keyring_1.1-1_all.deb
apt update
apt install -y cuda-toolkit-13-0

Now clone and build Nunchaku:

@FNGarvin
FNGarvin / README.md
Created May 9, 2026 15:37
Simplest API Use of Stable-Diffusion.cpp

I own Nvidia and have a preference for Podman containers, so I'm using the stable-diffusion.cpp official cuda image. The same general idea works for running the binaries directly, though.

I am using flux.2 Klein 4b in Q4 for this example because it's tiny, new, and because it supports edit features. You probably need a ~16GB GPU to do 1MP as done here, but even running on the CPU alone should work at ~512x512 (very slowly) if you have 12GB+ of system RAM.

Directory structure for this particular example is setup like this:

.
├──  models
│   ├──  4b.gguf
│   ├──  qwen3.gguf
@FNGarvin
FNGarvin / podman_wsl2_howto.md
Created May 7, 2026 16:25
Why to use Podman/Docker in WSL and HOW to do so

I frequently use Podman (it's a Docker alternative that doesn't require a daemon and was quicker to adopt rootless setups with better host security). It's relevant because Podman and Docker both ONLY support Linux. So if you're on Windows, they both require you to install WSL2 (Windows Subsystem for Linux v2). WSL2 is using parts of the Hyper-V architecture to run a full-fledged Linux kernel along the Windows kernel and it does so in a way that gets you easy and well supported access to your hardware without complicated passthrough. Assuming you're using Nvidia, the Nvidia Container Toolkit is specifically oriented towards allowing GPU access in containers, it is extremely robust, and widely used in commercial and enterprise deployments. In WSL, it basically tricks the Linux kernel to use your Windows system drivers.

Everything works GREAT and the performance is basically identical to using native Windows or

@FNGarvin
FNGarvin / 1 Torture Test Prompt and Input.md
Created May 3, 2026 16:37
Local Vision LLM Torture Testing on 16 GB GPU

Torture test Produced via Gemini and rendered via Nano Banana:

A hyper-realistic full-body fashion editorial shot of a woman wearing a complex, multi-layered avant-garde gown that merges 1930s Surrealism with Brutalist architecture.

The Garment: The base is a floor-length, bias-cut slip made of heavyweight 40mm charcoal silk crepe de chine that clings to the form with liquid-like drape. Over this is an external, architectural cage-crinoline constructed from matte-black structural steel ribs, creating a rigid geometric skeleton around the lower body. Attached to the steel frame are non-repeating laser-cut panels of obsidian-colored cavallino (pony hair) leather in a mathematical Voronoi pattern. The entire ensemble is shrouded in a fine layer of iridescent, translucent silk organza that catches a spectrum of oil-slick light.

The Technical Detail: Focus on the mechanical intersection where the steel ribs meet the silk; specify visible brass industrial rivets and tension-spring fasteners. The leather must sho

@FNGarvin
FNGarvin / batch_animals.py
Created May 2, 2026 00:34
Matchbox Animals Test
#!/usr/bin/env python3
"""
FNGarvin
Batch run ComfyUI workflow for multiple animals.
TODO: INSERT LICENSE
2026
"""
import json
import requests
@FNGarvin
FNGarvin / Easiest Possible Image Generation.md
Last active May 15, 2026 15:28
Easiest Possible Image Generation

The EASIEST way to get going creating images RIGHT NOW is with stable-diffusion.cpp. It has no external dependencies, so you don't have to fight Python or torch. Download the cuda binaries and exe if you have NVidia or otherwise grab this for Vulkan that runs on Intel, NVidia, and AMD.

Unzip and it should look something like this:image

Download some models to the same folder. Getting these three would be a good start: model, vae, llm.

Write a batch

@FNGarvin
FNGarvin / snoop_overlays
Created February 15, 2026 02:21
Podman Overlay Snoop: Maps physical hex-folders to containers/images with accurate size reporting.
#!/usr/bin/env python3
"""
Author: FNGarvin
License: MIT
Usage: snoop_overlays
Maps every folder in the overlay directory to Podman objects with
accurate size reporting using a robust find-sum method.
"""
@FNGarvin
FNGarvin / manifest_gen.sh
Last active February 7, 2026 15:02
Directory manifest generation script - compare two directories, skipping .git and models subdirs
rm -f manifest_aware.txt ; find . \( -name .git -o -name models -o -name .venv -o -name __pycache__ -o -name manifest* \) -prune -o -type f -exec sha256sum {} + | sort -k 2 > manifest_dir1.txt
rm -f manifest_aware.txt ; find . \( -name .git -o -name models -o -name .venv -o -name __pycache__ -o -name manifest* \) -prune -o -type f -exec sha256sum {} + | sort -k 2 > manifest_dir2.txt
etc, then inspect, diff, or compare checksums of the two manifests.
@FNGarvin
FNGarvin / README.md
Last active January 12, 2026 18:10
HOWTO: Download a Single File From a Docker Image

🛠️ HOWTO: Download a Single File From a Docker Image 🛠️

Quickstart:

Skip to the addendum for an automated script.

1. Set IMAGE and Collect Metadata

Define your image and use skopeo to pull the build history and the layer manifest.

IMAGE="docker://SOME_USERNAME/SOME_REPONAME[:OPTIONAL_TAG]"
@FNGarvin
FNGarvin / Automate NVIDIA CDI Refresh for Podman on WSL2.md
Created January 10, 2026 02:22
HOWTO: Automate NVIDIA CDI Refresh for Podman on WSL2

HOWTO: Automate NVIDIA CDI Refresh for Podman on WSL2

Why this is needed

Updating NVIDIA drivers on Windows often breaks the bridge to WSL2 containers. Because the Container Device Interface (CDI) file (/etc/cdi/nvidia.yaml) is a static snapshot of the driver state at the time of generation, any driver update renders the snapshot invalid. This usually results in Podman containers failing to find the GPU with jarring, cryptic, or non-existent error messages.

The Benefit

This solution provides "zero-touch" insurance. It checks your driver version at boot and only regenerates the CDI if a change is detected. By using a systemd service, it runs asynchronously in the background, adding negligible overhead (approx. 80ms) to your WSL startup time (zero per-shell latency).

Prerequisites

  • WSL Version: 0.58.0 or higher (Check via wsl --version in PowerShell).