---
license: wtfpl
---
# malcolmrey's Various AI Model, Architecture & Research Repository
Welcome to the central research and asset repository of **malcolmrey**. This repository hosts cutting-edge tools, custom architectures, RefMod latent adapter systems, video synthesis engines, training configurations, benchmark suites, cinematic scripts, and comprehensive educational guides spanning **MiniMax-H3**, **FLUX.2 / Klein 9B**, **Qwen-Image 2.1**, **WAN 2.1**, **LTX-Video**, **Z-Image**, **SDXL**, and **Stable Diffusion**.
Much of the training work here uses **[maltrainer](https://github.com/malcolmamal/maltrainer)**, malcolmrey's own LoRA trainer.
---
## ๐งญ Repository Map & Quick Navigation
| Section / Directory | Focus Area & Description | Key Resources & Direct Links |
| :--- | :--- | :--- |
| ๐ฌ **[`h3-center/`](h3-center/)** | **MiniMax-H3 Video & Cinema Hub**
Complete prompt guides, RefMod stacking, hybrid LoRA+RefMod containers, identity-LoRA epoch sweeps, 1,500+ character tests, and 9-episode Crossovers cinematic series. | โข [Prompting Guide](h3-center/docs/MINIMAX_H3_PROMPTING_GUIDE.md)
โข [RefMod Stacking Guide](h3-center/docs/MINIMAX_H3_REFMOD_STACKING_AND_MULTISUBJECT_GUIDE.md)
โข [Hybrid LoRA+RefMod Guide](h3-center/docs/MINIMAX_H3_HYBRID_LORA_REFMOD_CONTAINERS_GUIDE.md)
โข [Jinx LoRA Epoch Sweep & RefMod Stack](h3-center/docs/lora/README.md)
โข [Multistacking Benchmark Demos](h3-center/docs/multistacking/README.md)
โข [Known Characters Usability Index](h3-center/known-characters/INDEX.md)
โข [Crossovers Cinema Series](h3-center/crossovers/README.md) |
| ๐จ **[`klein9/`](klein9/)** | **FLUX.2 & Klein 9B RefMods**
Instant reference latent adapter ecosystem, custom ComfyUI nodes, CLI batch extractor, and benchmark suites. | โข [RefMod Architecture Guide](klein9/docs/FLUX2_KLEIN9_REFMODS_GUIDE.md)
โข [ComfyUI Node](klein9/comfyui/custom_nodes/ComfyUI-Flux2Klein9Mod/)
โข [Batch Extractor Tool](klein9/generate_flux2_klein9_refmod.py)
โข [Workflows](klein9/workflows/) \| [Visual Benchmarks](klein9/docs/VISUAL_BENCHMARKS_AND_COMPARISONS.md) |
| ๐๏ธ **[`qwen/`](qwen/)** | **Qwen-Image 2.1 Multimodal Hub**
Vision-Language (Qwen3-VL) conditioning architecture, reference strategy analysis, identity transfer, prompt engineering standards, edit samples, and a LoRA optimizer benchmark trained with maltrainer. | โข [RefMod Compatibility & ViT Architecture](qwen/docs/QWEN_IMAGE_21_REFMOD_COMPATIBILITY_AND_VISION_ENCODER_ARCHITECTURE.md)
โข [Reference Strategy & Prompting Guide](qwen/docs/QWEN_IMAGE_21_REFERENCE_STRATEGY_AND_PROMPTING_GUIDE.md)
โข [LoRA Optimizer Benchmark (maltrainer)](qwen/docs/QWEN_IMAGE_21_LORA_OPTIMIZER_BENCHMARK.md)
โข [Qwen Hub Overview](qwen/README.md) |
| ๐งช **[`moss/`](moss/)** | **MOSS-Image LoRA Training**
Combined training: one dataset trained with AdamW 8-bit, Automagic3 and Prodigy at short lengths, merged into one LoRA soup and resized to rank 8. Trained with maltrainer. | โข [Combined Optimizer Training Guide](moss/docs/MOSS_IMAGE_COMBINED_OPTIMIZER_TRAINING_GUIDE.md)
โข [Member Templates](moss/templates/) (AdamW 8-bit, Automagic3, Prodigy) |
| โก **[`zimage-turbo-vs-base-training/`](zimage-turbo-vs-base-training/)** | **Z Image Base vs. Turbo Benchmark**
Head-to-head training comparison across OneTrainer, MalTrainer, and AI Toolkit with datasets and weights. | โข [Benchmark Overview & Configs](zimage-turbo-vs-base-training/README.md)
โข Datasets, AdamW/Prodigy configs, & `.safetensors` weights |
| ๐ ๏ธ **[`training-scripts/`](training-scripts/)** | **Production Training Configs**
Ready-to-use recipes for OneTrainer, Musubi Tuner, AI Toolkit, and MalTrainer. | โข [OneTrainer Templates](training-scripts/onetrainer/) (Ernie, FK9, Krea2, SDXL, Z-Image)
โข [Musubi Pipelines](training-scripts/musubi/) (Ernie, LTX23)
โข [AI Toolkit](training-scripts/aitoolkit/) (FK9, Ideogram 4, WAN, Z-Image)
โข [MalTrainer](training-scripts/maltrainer/) (Qwen-Image 2.1, Z-Image) |
| ๐ฅ **Sample Media & Benchmarks** | **Model Generation Sample Libraries**
High-fidelity outputs and verification test suites. | โข [`ltx23-samples/`](ltx23-samples/) (20 LTX-Video 2.3 renders)
โข [`ernie-samples/`](ernie-samples/) (`ernie-samples.zip`)
โข [`samples/fk9/`](samples/fk9/) (Rose Byrne & Sydney Sweeney outputs)
โข [`qwen/samples/edit/`](qwen/samples/edit/) (11 Qwen-Image 2.1 character edits) |
| ๐๏ธ **[`datasets/`](datasets/)** | **Sample Training Datasets**
Small image sets used in the training experiments. | โข [`datasets/jinx/`](datasets/jinx/) (19 images)
โข [`datasets/karengillan/`](datasets/karengillan/) (22 images) |
| ๐ **Guides & Articles** | **Comprehensive Knowledge Base**
In-depth technical guides for model training, optimization, and prompt engineering. | โข [WAN 2.1 LoRA Training Tutorial](tutorials/wan-21-lora-training.md)
โข [CivitAI Articles Collection](articles.md) |
---
## ๐ฌ MiniMax-H3 Center (`h3-center/`)
The **MiniMax-H3 Center** is an all-in-one research laboratory and production studio for the MiniMax Hailuo 01 / H3 text-to-video, image-to-video (I2V), reference-to-video (R2V), and clip-to-video (C2V) architectures.
### ๐ In-Depth Guides & Technical Documentation
- ๐ **[MiniMax-H3 Video Prompt Writing Guide (v1.3.0)](h3-center/docs/MINIMAX_H3_PROMPTING_GUIDE.md)**: The authoritative standard for prompting MiniMax-H3. Covers pinpoint actor casting, character tag binding (``), timestamped action choreography (`through 00:08.000`), diegetic soundscapes, non-diegetic audio rules, camera vectors, and anti-patterns.
- ๐งฌ **[RefMod Stacking & Multi-Subject Architecture Guide](h3-center/docs/MINIMAX_H3_REFMOD_STACKING_AND_MULTISUBJECT_GUIDE.md)**: Guide on injecting multiple pre-encoded latent references (`.safetensors`), single-persona Triple-RefMod fidelity stacking, conceptual body shape boosters, dual-persona shared frame conditioning, dual audio lip-syncing, and polyphonic counterpoint duets.
- ๐ฆ **[Hybrid LoRA + RefMod Container Specification Guide](h3-center/docs/MINIMAX_H3_HYBRID_LORA_REFMOD_CONTAINERS_GUIDE.md)**: Technical guide and implementation for embedding both LoRA weights and RefMod reference latents in a single `.safetensors` file, fully compatible with standard LoRA loaders (Power Lora Loader) and dedicated dual ComfyUI loader nodes.
- ๐ฌ **[Multi-Stacking Benchmark Demos & Video Suite](h3-center/docs/multistacking/README.md)**: Verified `.mp4` benchmarks demonstrating single-persona Triple RefMods (Billie Eilish), dual conversations (Billie & Miley Cyrus), simultaneous two-shots, dual audio conditioning, and counterpoint singing duets with local RefMod latent files.
- ๐ **[C2V Continuous Chain Generation Guide](h3-center/docs/C2V_CONTINUOUS_CHAIN_GUIDE.md)**: Pipeline for chaining 5-second to 15-second video clips losslessly into seamless continuous takes.
- ๐ต **[Audio-Synchronized & C2V Music Videos Guide](h3-center/docs/MINIMAX_AUDIO_SYNC_AND_C2V_MUSIC_VIDEOS.md)**: Techniques for aligning video cadence and singing motion with pre-recorded vocal tracks.
- โ๏ธ **[RefMods Installation & Usage Guide](h3-center/docs/MINIMAX_H3_REFMODS_INSTALLATION_AND_USAGE_GUIDE.md)** & **[RefMod Creation Guide](h3-center/docs/MINIMAX_H3_REFMOD_CREATION_GUIDE.md)**: Step-by-step instructions for extracting RefMod `.safetensors` from images and loading them into ComfyUI pipelines.
- โ๏ธ **[RefMods vs. Reference Images Comparison](h3-center/docs/MINIMAX_REFMODS_VS_REFERENCE_IMAGES.md)**: Architectural analysis of speed, latent fidelity, and token efficiency comparing pre-computed RefMods against raw pixel reference workflows.
- ๐งช **[Jinx Identity LoRA Epoch Sweep & RefMod Stack](h3-center/docs/lora/README.md)**: A/B of an identity LoRA (epochs 60 / 80 / final) against a single identity RefMod and both combined, with 6 verified `.mp4` clips. Findings: **RefMod + LoRA is the strongest identity lock**, epoch 60 is already enough, and the LoRA carries the Arcane art style along with the face.
- ๐ **RefMod generator script:** [`h3-center/docs/scripts/generate_refmod.py`](h3-center/docs/scripts/generate_refmod.py)
### ๐ฅ Known Characters & Usability Database
- ๐ **[Usability Index (INDEX.md)](h3-center/known-characters/INDEX.md)** & **[Unusable Index (INDEX_BAD.md)](h3-center/known-characters/INDEX_BAD.md)**: Empirical test results evaluating over **1,500+** characters, actors, and public figures directly in MiniMax-H3:
- **Good (540+ subjects):** Characters with zero-shot likeness locks (e.g., House, Dexter, Michael Scott, Walter White, Gandalf, Wednesday Addams, Dean Winchester).
- **On the Fence (90+ subjects):** Subjects requiring targeted prompt tuning or RefMod assistance.
- **Bad (920+ subjects):** Subjects that fail without custom LoRAs or dedicated RefMods.
### ๐ฅ Crossovers Episodic Cinema Series
- ๐ฟ **[Crossovers Series Master Catalog](h3-center/crossovers/README.md)**: 9 narrative episodes created with MiniMax-H3, with cast listings and synopses (8 rendered `.mp4` files in the repo):
- **Episode 1:** *The Contagion of Secrets* (House, Monk, Dwight, Dexter, Malcolm Reynolds, Mulder, Penny)
- **Episode 2:** *The Cosmic Extradition* (Dean Winchester, Mal Reynolds, Sherlock, Pam Beesly, Lucifer, 10th Doctor, Saul Goodman, Steve Rogers, John Locke, Tony Stark)
- **Episode 3:** *Lockdown at Sabre Tower* (Michael Scott, Wednesday Addams, John McClane, Seeley Booth, James Bond, Steve Rogers, Elliot Alderson, Lucifer, Jack Bauer)
- **Episode 4:** *The War for the Obsidian Portal* (Maleficent, Daenerys, Gandalf, Dr. Strange, Hermione, Maximus, Jack Sparrow)
- **Episode 5:** *The Flat Earth Experience* (Joe Rogan, Kanye West, Neil deGrasse Tyson, Dave Chappelle, Sir Anthony Hopkins)
- **Episode 6:** *Dave Chappelle: The Flat Earth Special* (Stand-up comedy special)
- **Episode 7:** *Dr. Robert Ford: On Meaning* (Philosophical monologue from Westworld)
- **Episode 8:** *Ellis Boyd 'Red' Redding: On Hope and Love* (Shawshank monologue)
- **Episode 9:** *Captain Malcolm Reynolds: Alone on Serenity* (Firefly character study)
- ๐ **[Show & Character Guides (`h3-center/crossovers/docs/shows/`)](h3-center/crossovers/docs/shows/)**: Over **250+** show guides detailing character wardrobe, distinctive traits, and scene rules.
---
## ๐จ FLUX.2 & Klein 9B RefMods (`klein9/`)
**RefMods (Reference Latent Adapters)** provide zero-shot facial fidelity and concept locking for **FLUX.2**, **Klein 4B**, **Klein 8B**, and **Klein 9B** without the VRAM overhead or training time required by full fine-tunes or LoRAs.
- ๐ **Interactive Model Browser:** [https://huggingface.co/spaces/malcolmrey/browser](https://huggingface.co/spaces/malcolmrey/browser) (Explore 1,400+ pre-extracted RefMods)
- ๐ค **Model Weights Hub:** [https://huggingface.co/malcolmrey/klein9](https://huggingface.co/malcolmrey/klein9) (Download `.safetensors` adapters)
- ๐ **ComfyUI Custom Node:** [`klein9/comfyui/custom_nodes/ComfyUI-Flux2Klein9Mod/`](klein9/comfyui/custom_nodes/ComfyUI-Flux2Klein9Mod/) (Also available on [GitHub](https://github.com/malcolmamal/ComfyUI-Flux2Klein9Mod))
- โก **CLI Generator & Mass Batch Extractor:** [`klein9/generate_flux2_klein9_refmod.py`](klein9/generate_flux2_klein9_refmod.py)
- ๐ **Architecture & Extraction Guide:** [`klein9/docs/FLUX2_KLEIN9_REFMODS_GUIDE.md`](klein9/docs/FLUX2_KLEIN9_REFMODS_GUIDE.md)
- ๐ **Visual Benchmarks & Comparisons:** [`klein9/docs/VISUAL_BENCHMARKS_AND_COMPARISONS.md`](klein9/docs/VISUAL_BENCHMARKS_AND_COMPARISONS.md)
- ๐ **Production Workflows:**
- Pure RefMod Text-to-Image: [`klein9/workflows/workflow_klein9_refmod.json`](klein9/workflows/workflow_klein9_refmod.json)
- Hybrid RefMod + LoRA Stack: [`klein9/workflows/workflow_klein9_refmod_lora.json`](klein9/workflows/workflow_klein9_refmod_lora.json)
- ๐ผ๏ธ **Sample Generations:** [`samples/fk9/`](samples/fk9/) (Rose Byrne and Sydney Sweeney benchmark runs)
---
## ๐๏ธ Qwen-Image 2.1 Multimodal Hub (`qwen/`)
The **Qwen-Image 2.1 Hub** covers empirical research and architectural standards for image generation and character identity transfer using the **Qwen-Image 2.1 Diffusion Transformer + Qwen3-VL Vision-Language conditioning pipeline**.
### ๐ Technical Documentation & Guides
- ๐ **[RefMod Compatibility & Vision-Language Architecture Analysis](qwen/docs/QWEN_IMAGE_21_REFMOD_COMPATIBILITY_AND_VISION_ENCODER_ARCHITECTURE.md)**: Details why pre-encoded VAE RefMod adapters (`.safetensors` from MiniMax-H3 / FLUX.2) are mathematically incompatible with Qwen-Image 2.1, explaining Qwen3-VL's live ViT patch projection, dynamic token insertion, and joint cross-attention.
- ๐ **[Reference Strategy, Prompting Standards & Identity Preservation Guide](qwen/docs/QWEN_IMAGE_21_REFERENCE_STRATEGY_AND_PROMPTING_GUIDE.md)**: Complete empirical benchmarking of reference strategies:
- Demonstrates why **1 Reference Image per Person** is the optimal standard.
- Documents failure modes of multi-image referencing for single subjects (token dilution, feature blending).
- Documents failure modes of 2x2 and 3x3 composite grids (grid leak, loss of high-frequency skin textures).
- Provides master production prompt templates for precision face-swapping (preserving body, pose, age, skin pores, and clothing) and multi-character scenes.
- ๐๏ธ **[LoRA Optimizer Benchmark: AdamW vs Prodigy vs Automagic3](qwen/docs/QWEN_IMAGE_21_LORA_OPTIMIZER_BENCHMARK.md)**: Two-subject LoRA benchmark (Felicia Day, Rhea Seehorn) trained with **[maltrainer](https://github.com/malcolmamal/maltrainer)** on one RTX 5090 directly from the ComfyUI INT8 checkpoints. Every checkpoint was scored for likeness (ArcFace), prompt adherence (Qwen3-VL judge), seed diversity and memorization.
- **Recommended: Automagic3, ~1500 steps (60โ80 epochs), โ13โ16 minutes.** Likeness plateaus by ~1250 steps and stays flat, with the best prompt adherence and the smallest adapter.
- Likeness is a tie across optimizers; Prodigy's learning rate keeps climbing until it memorizes the training set and ignores the prompt.
- Caption finding: if captions say only "a woman โฆ", the trigger never learns gender, so prompt with `", a woman, โฆ"`.
- Ready-to-use config: [`training-scripts/maltrainer/qwen_image_2_1_template.yaml`](training-scripts/maltrainer/qwen_image_2_1_template.yaml)
### ๐ผ๏ธ Samples
- **[`qwen/samples/edit/`](qwen/samples/edit/)**: 11 Qwen-Image 2.1 reference-edit outputs placing actors into iconic roles (e.g. Al Pacino as Tony Montana, Charlize Theron as Furiosa, Mads Mikkelsen as Hannibal Lecter, Gillian Anderson as Dana Scully).
---
## โก Z Image Base vs. Z Image Turbo Training Suite (`zimage-turbo-vs-base-training/`)
An empirical training study benchmarking **Z Image (Base)** against **Z Image (Turbo)** using identical curated datasets (Felicia Day, Olivia).
- ๐ **[Overview & Documentation](zimage-turbo-vs-base-training/README.md)**
- ๐ **Dataset:** [Curated 23-image high-resolution dataset](https://huggingface.co/datasets/malcolmrey/various/tree/main/zimage-turbo-vs-base-training/dataset)
- โ๏ธ **OneTrainer Configs:** AdamW and Prodigy optimization profiles (`.json`)
- ๐ค **MalTrainer & AI Toolkit Recipes:** Full training configurations (`.yaml`)
- ๐ฆ **Trained Weights:** Verified `.safetensors` models for both Base and Turbo versions
---
## ๐ ๏ธ Production Training Scripts & Templates (`training-scripts/`)
Curated configurations for high-efficiency model training across popular trainers:
- ๐ข **[OneTrainer (`training-scripts/onetrainer/`)](training-scripts/onetrainer/)**:
- `fk9_template.json` & `fk9_prodigy_template.json` โ Klein 9B / FLUX.2 LoRA templates
- `ernie_template.json` โ Ernie training configuration
- `krea2_template.json` & `krea2prodigy_template.json` โ Krea 2 templates
- `sdxl_template.json` & `sdxl_prodigy_template.json` โ SDXL templates
- `zimage_base_template.json` & `zimage_turbo_template.json` โ Z-Image Base / Turbo templates
- ๐ฃ **[Musubi Tuner (`training-scripts/musubi/`)](training-scripts/musubi/)**:
- `musubi/ernie/` โ Multi-resolution Ernie training scripts
- `musubi/ltx23/` โ LTX-Video 2.3 video model training configurations
- ๐ต **[AI Toolkit (`training-scripts/aitoolkit/`)](training-scripts/aitoolkit/)**:
- `fk9_template.yaml` & `fk9r_template.yaml` โ Klein 9B / FLUX.2
- `ideogram4_template.yaml` โ Ideogram 4
- `wan_template.yaml` โ WAN 2.1
- `zimage_template.yaml`, `zbase_template.yaml` & `zonetrainer_template.yaml` โ Z-Image variants
- ๐ **[MalTrainer (`training-scripts/maltrainer/`)](training-scripts/maltrainer/)** โ configs for **[maltrainer](https://github.com/malcolmamal/maltrainer)**, malcolmrey's own trainer:
- `qwen_image_2_1_template.yaml` โ Qwen-Image 2.1 LoRA, the benchmark's recommended setting (Automagic3, ~1500 steps). Trains directly on the ComfyUI INT8 checkpoints. See the [optimizer benchmark](qwen/docs/QWEN_IMAGE_21_LORA_OPTIMIZER_BENCHMARK.md).
- `zimage_base_template.yaml` โ Z-Image Base LoRA
---
## ๐ฅ Video Samples & Benchmarks
- ๐๏ธ **[`ltx23-samples/`](ltx23-samples/)**: 20 full-motion test videos evaluating coherence, prompt fidelity, and motion dynamics with **LTX-Video 2.3**.
- ๐ฆ **[`ernie-samples/`](ernie-samples/)**: Comprehensive benchmark sample package (`ernie-samples.zip`).
- ๐ฌ **[`h3-center/crossovers/`](h3-center/crossovers/)**: 8 rendered `.mp4` full narrative crossover episodes.
- ๐ผ **[`h3-center/docs/multistacking/`](h3-center/docs/multistacking/)**: 8 dual-audio and counterpoint singing benchmark videos.
- ๐งช **[`h3-center/docs/lora/`](h3-center/docs/lora/README.md)**: 6 Jinx identity-LoRA / RefMod comparison clips (5 s, 1344ร768).
- ๐ค **[`h3-center/docs/examples/`](h3-center/docs/examples/)**: 6 Billie Eilish / Miley Cyrus speech, singing and two-shot test clips.
- ๐๏ธ **[`ltx-artifacts.zip`](ltx-artifacts.zip)**: 107 MB archive of LTX-Video material.
---
## ๐๏ธ Sample Datasets (`datasets/`)
Small image sets used in the training experiments (images only, no caption files):
- **[`datasets/jinx/`](datasets/jinx/)** โ 19 images (Jinx / Arcane)
- **[`datasets/karengillan/`](datasets/karengillan/)** โ 22 images (Karen Gillan)
---
## ๐ Tutorials & Articles Collection
### ๐ [WAN 2.1 LoRA Training Tutorial](tutorials/wan-21-lora-training.md)
Complete step-by-step guide on training WAN 2.1 LoRA models using AI Toolkit:
- Dataset preparation (20 optimal images, 2500 steps)
- Resolution bucketing & learning rate schedules
- VRAM management & cloud GPU configurations
- ComfyUI inference workflow integration
### ๐ [CivitAI Articles Collection](articles.md)
Curated directory of malcolmrey's published training and generation guides:
- **[DreamBooth / LyCORIS / LoRA Complete Guide](https://civitai.com/articles/7/dreambooth-lycoris-lora-guide)**
- **[SDXL LoRA Training on RunPod](https://civitai.com/articles/1591/sdxl-lora-training)**
- **[Textual Inversion / Embedding Training Guide](https://civitai.com/articles/3114/textual-inversion-embedding-training-guide)**
- **[Flux Guide, Part I - LoRA Training](https://civitai.com/articles/9360/flux-guide-part-i-lora-training)**
- **[Improving Results with Multi-Model Blending (Turning it to 11!)](https://civitai.com/articles/1721/improving-results-by-using-multiple-models-of-the-same-concept-turning-it-to-11)**
- **[Quality Deep Dive (Bringing it up to Twelve!)](https://civitai.com/articles/3527/bringing-it-up-to-twelve-going-deep-into-quality)**
- **[ADetailer, Inpainting & Facial Restoration Best Practices](https://civitai.com/articles/1633/adetailer-and-a-poll-and-a-few-words-about-roop)**
---
## ๐ Connect with malcolmrey
- ๐ฌ **Discord Community:** [malcolmrey's place](https://discord.gg/RjYRPRCqu)
- โ **Support / Priority Requests:** [Buy Me a Coffee](https://buymeacoffee.com/malcolmrey)
- ๐ค **Hugging Face Hub:** [https://huggingface.co/malcolmrey](https://huggingface.co/malcolmrey)
- ๐ **Interactive Model Browser:** [https://huggingface.co/spaces/malcolmrey/browser](https://huggingface.co/spaces/malcolmrey/browser)
- ๐จ **CivitAI Profile:** [https://civitai.com/user/malcolmrey](https://civitai.com/user/malcolmrey)
- ๐ฌ **Reddit Community:** [r/malcolmrey](http://reddit.com/r/malcolmrey)