Sign In

AGGA 2026: The Sampler & Scheduler Pack I made.

Type

Other

Stats

109

0

Reviews

Published

Jan 27, 2026

Base Model

Illustrious

Usage Tips

Clip Skip: 2

Hash

AutoV2
51B0983B27

👋 If you like what I do and want to support the development, feel free to buy me a coffee:

Ko-Fi


Hey!, you're probably wondering: "Are you still alive...?" No. Well... actually, I'm back with something juicy. The truth is, I'm in the red and I simply refuse to buy another external hard drive just to fill it with thousands of LoRAs.

So, instead of more gigabytes, I brought you Intelligence. There are always new LoRAs, LyCORIS, and VAEs, but nobody looks at the "brain" of the checkpoint. We need to make it smarter, not just limit ourselves to the classics.

This is not just a set of scripts; it is an Intelligent Rendering Engine designed for Stable Diffusion. While standard samplers traverse noise linearly, AGGA uses latent masks, dynamic momentum, and temporal anchors to ensure every pixel has a purpose.

Compatibility Note: These samplers and schedulers are fully cross-compatible with the original A1111/Forge samplers. You can mix standard samplers with AGGA schedulers and vice versa.


⚠️ Installation (The "Core Touch" Method)

I had some issues wrapping this as a standard extension (too much overhead), so I went for the most efficient, "Power User" route: Direct Core Integration. It's faster, lighter, and works natively in A1111 and WebUI Forge.

  1. Step 1: Drop the .py files into your modules folder.

  2. Step 2: Open modules/sd_schedulers.py and add this line at the very end:

    import modules.sd_agga_schedulers
  3. Step 3: Open modules/sd_samplers_kdiffusion.py and add this line at the very end:

    import modules.sd_samplers_pseudo_hires_loader

That's it. No complex installation, just pure python logic injection.


  • 100% Laziness MODE!

# @title ⚙️ AGGA Engine: Auto-Injector (Run after uploading files)
# INSTRUCTIONS:
# 1. Upload 'sd_agga_schedulers.py', 'sd_samplers_pseudo_hires.py', and 'sd_samplers_pseudo_hires_loader.py' to the /content folder.
# 2. Run this cell. It will auto-detect your WebUI (A1111/Forge) and install the engine.

import shutil
import os
from pathlib import Path

# 1. Configuración de Rutas / Path Configuration
HOME = Path('/content')
# Lista de posibles rutas de instalación / List of possible install paths
base_paths = [
    Path('/content/stable-diffusion-webui'),
    Path('/content/webui_forge_cu121_torch231/stable-diffusion-webui'), # Common Forge path
    Path('/content/A1111'),
    Path('/content/gdrive/MyDrive/sd/stable-diffusion-webui')
]

# Detectar ruta activa / Detect active path
WEBUI_PATH = next((p for p in base_paths if p.exists()), Path('/content/stable-diffusion-webui'))
TARGET_MOD = WEBUI_PATH / "modules"

# 2. Archivos a procesar / Files to process
agga_files = [
    'sd_agga_schedulers.py',
    'sd_samplers_pseudo_hires.py',
    'sd_samplers_pseudo_hires_loader.py'
]

def handle_agga_files():
    missing = []
    if not TARGET_MOD.exists():
        print(f"❌ Error: 'modules' folder not found in {WEBUI_PATH}")
        return agga_files

    print(f"🚚 Moving AGGA Engine to: {TARGET_MOD}")
    for f_name in agga_files:
        src = HOME / f_name
        dst = TARGET_MOD / f_name

        if src.exists():
            # Si ya existe en el destino, lo borramos para evitar errores / Overwrite safety
            if dst.exists():
                os.remove(dst)

            shutil.move(str(src), str(dst))
            print(f"  ✅ {f_name} installed successfully.")
        elif not dst.exists():
            missing.append(f_name)
        else:
            print(f"  ℹ️ {f_name} was already installed.")
    return missing

def patch_core_module(file_path, import_line):
    if not file_path.exists():
        print(f"  ❌ File not found: {file_path.name}")
        return

    content = file_path.read_text()
    if import_line not in content:
        with open(file_path, "a") as f:
            f.write(f"\n{import_line}\n")
        print(f"  💉 Code injection applied to: {file_path.name}")
    else:
        print(f"  ✨ {file_path.name} is already patched.")

# --- EXECUTION ---
print(f"🔍 WebUI detected at: {WEBUI_PATH}")
missing_files = handle_agga_files()

if not missing_files:
    print("\n🛠️ Patching Core System...")
    patch_core_module(TARGET_MOD / "sd_schedulers.py", "import modules.sd_agga_schedulers")
    patch_core_module(TARGET_MOD / "sd_samplers_kdiffusion.py", "import modules.sd_samplers_pseudo_hires_loader")
    print(f"\n✅ AGGA Engine Deployed successfully. Ready to generate.")
else:
    print(f"\n⚠️ Warning: Source files not found in /content: {', '.join(missing_files)}")
    print("Please upload the .py files to the Colab root folder first.")

🧠 The "Landing Phase" Concept

The main difference between AGGA and standard tools lies in the Landing Phase and Noise Injection. Standard samplers often "wash out" details in the final 20% of steps to eliminate noise. AGGA does the opposite: it detects where the edges and textures are and reinforces detail just before finishing.


🛠️ Sampler Guide (Movement Engines)

1. The "Pseudo-Hires" Series (General Purpose & Speed)

  • Pseudo-Hires Soft: The base engine. It uses a pure Euler trajectory with a custom noise ramp for a balanced composition without artifacts.

  • Pseudo-Hires Sharp: Introduces an energy reinforcement of 1.12x in the last third of generation (step > 65%), ideal for defining metallic edges and hard textures.

  • Pseudo-Hires Ultra: Our most aggressive configuration. It applies a progressive boost that scales up to 1.18 + progress * 0.10 to maximize detail in hair and skin.

  • DPM++ 2M Pseudo-Hires: A second-order version for those who prefer DPM stability, but with an extra "push" at the end to avoid that typical soft/washed-out look of standard DPM.

🌟 NEW: AGGA Pseudo-HiRes Flash v9 (Universal Fusion)

This major update transforms the Flash sampler into a "Universal 4-in-1 Engine". It is no longer just a fast sampler; it acts as a Smart Engine that adapts its mathematics based on your step count and prompt commands:

  • Auto-Rescue Mode (<15 Steps): The engine analyzes the image "energy" at step 0.

    • If the image is too flat/grey, it activates Euler Ancestral to inject life.

    • If the image is too chaotic, it activates DPM++ 2M to enforce structure.

    • If the image is balanced, it uses Native for maximum speed.

  • High-Res Mode (>15 Steps): Automatically activates the classic Flash V2 engine to achieve that sharp, high-contrast texture (latex, armor, mesh details).

  • Fusion Mode (New): You can now mix two samplers in a single generation using prompt tags (see Prompts section below).

  • Exact-Match Math: The internal engines for DPM++ 2M and Euler A have been rewritten to be 1:1 mathematical replicas of the official K-Diffusion library. You get official quality with AGGA's smart logic.

2. The "Native" Series (Detail & Structure)

  • AGGA Detail-Native: An internal "Refiner" mode. In the last 40% of generation, it "tricks" the model with a lower sigma to force it to draw micro-details like pores and fine hairs without changing the composition.

  • AGGA Structural-Detail (Hybrid) [NEW]: The best of both worlds. The first 45% uses DPM++ 2M logic for perfect anatomical coherence, then seamlessly switches to the AGGA Detail engine to inject texture. Perfect for complex bodies.

  • AGGA Hyper-Detail Hybrid: Splits generation into two distinct phases: the first 66% is dedicated to clean structure (V2) and the rest to aggressive edge refinement (V4).

3. The "Specialist" Series (Specific Use Cases)

  • AGGA DMD-Turbo Landing: Specifically for distilled models (Lightning/Turbo/4-8 steps). It replaces the last Euler step with a direct interpolation toward the clean image for a "crystalline" finish.

  • AGGA Herrscher-Native: Momentum-based engine (0.50). Includes a recovery system that "pushes" tensor energy if it drops below 1.0, keeping colors and contrast vibrant.

  • AGGA Style-Repair: Designed to rescue the essence of Checkpoints. It extracts a "Style-Delta" by perturbing noise every 3 steps to recover concepts diluted by the model.

  • AGGA Style-Repair Ultra: The definitive version for a "Studio Look". It includes an atmospheric mask that protects the background while repairing the 3D volume of the main subject.

  • AGGA Pixel-Master: A latent quantization engine. In the last step, it applies a spatial resize (Downscale area -> Upscale nearest) to force the model to work on a fixed pixel grid and limited color palette. Use this for authentic Latent Pixel Art (SNES/NES style).


🌉 AGGA Universal Bridge (The Model Translator)

I decided to make Illustrious, NoobAI, SDXL, and PDXL more compatible with each other. This sampler is a mathematical bridge designed so that models that speak different "languages" (different energy and brightness structures) can understand each other without errors.

Unlike other samplers that inject LoRA force linearly or abruptly, Universal Bridge uses a Quartic Stability Curve: f(p) = 1.0 - (2p - 1.0)^4. This formula creates a 'plateau' of compatibility in the intermediate steps, protecting the original anatomy at the beginning and preventing the texture from becoming 'pasty' or gray at the end.

How does it work? When you press "Generate," the sampler performs three critical tasks in milliseconds:

  1. DNA Detection (Step 0): It measures the energy of the base model (checking if it's Velvette, Illustrious, etc.).

  2. Synchronization: If it detects a direction command (e.g., Hacia_Velvette), it adjusts the contrast and color so that the LoRA feels "at home."

  3. Aesthetic Refinement: Applies a Sharpening Injector and a safety floor to prevent the image from looking blurry or gray.

Practical Example: Prompt: <lora:Pony_Style_V2:1> Hacia_Velvette, Modo_Neutral

  • The system loads a Pony LoRA (Expected Energy: 0.016593).

  • Hacia_Velvette: Translates that DNA towards the Velvette destination (Std: 0.019734). Prevents Pony's aggressive aesthetic from breaking the delicate model.

  • Modo_Neutral: Deactivates heavy color translation but keeps the Sharpening Injector active for perfect edges.


📐 Scheduler Guide (Noise Maps)

The scheduler decides how much "strength" the noise has at each step. AGGA offers maps that standard schedulers cannot replicate.

1. Intelligent & Adaptive (Smart V2)

  • AGGA Smart (Updated to v2): Intelligent logic with 5 time zones based on your step count:

    • 1-4 Steps: Lightning Curve (Instant convergence).

    • 5-8 Steps: Turbo/DMD Curve (Aggressive, optimized for Flash).

    • 9-19 Steps: AYS (Align Your Steps) Curve - The sweet spot for Fusion modes.

    • 20-49 Steps: Dynamic Rho (High fidelity).

    • 50+ Steps: Double Anchor (Deep repair/upscaling).

  • Dynamic Rho: The value of ρ evolves from 5.0 to 9.0. This provides a very stable structure at the beginning and ultra-fine refinement at the end.

2. Anchors (Time Warping)

  • Style-Anchor: Creates a sinusoidal time "plateau" in the style sigmas. The sampler spends more real-time processing the middle steps where aesthetics are defined.

  • Ultra-Anchor: Reinforced version (factor 0.32). Creates a pseudo-plateau where time seems to stop to inject the maximum amount of style possible.

  • Double-Anchor (The Sniper): Our most advanced scheduler. It combines style anchoring with a "sniper" dip at 82% of the process to fix critical details like eyes and faces.

  • AGGA AYS-Anchor [NEW]: Combines NVIDIA's "Align Your Steps" optimized values with AGGA's anchor warping. Science + Art.

3. Specialized

  • AGGA DMD: Extreme power curve (ρ = 7.0). Ideal for Lightning models.

  • Log-Linear: A perfect logarithmic distribution. The "gold standard" for the Detail-Native sampler.

  • Pixel-Staircase V1 & V2: A staircase of sigmas. It groups steps (e.g., 3 by 3) so the sampler has time to "settle" the pixel quantization before dropping to the next level. V2 adds "Edge Locking" for cleaner sprites.


🎮 Prompt Command Guide (Total Control)

AGGA allows you to control the internal engine behavior directly from your prompt.

Fusion Commands (For Flash v9 Sampler)

Mix two engines to get the best of both worlds:

  • fsn_euler_dpm: Creativity + Precision. Euler creates rich colors, DPM cleans lines. (Ideal: Complex illustrations, backgrounds, abstract art).

  • fsn_native_flash: Stability + Texture. Native ensures perfect anatomy, Flash injects the "crunch". (Ideal: Latex, armor, 8k details).

  • fsn_dpm_euler: Structure + Softness. DPM builds a solid body, Euler softens skin at the end. (Ideal: Soft female portraits, oil painting).

  • fsn_native_dpm: The Tank. Maximum structural stability. Almost impossible to break. (Ideal: Difficult hands, complex poses).

  • Split Control: Decide when the switch happens (Default 50%). E.g., split_30 (switch at 30%), split_80.

Universal Bridge Commands (LoRA Compatibility)

Use these commands (in Spanish) to direct the DNA translation:

  • Destination (Hacia_): Indicates towards which "DNA" to translate the influence.

    • Hacia_Pony, Hacia_Noobai, Hacia_Illustrious_V2, Hacia_Velvette, Hacia_SDXL, etc.

  • Source (Desde_): To override automatic detection if using a heavily modified merge.

    • Desde_Pony, Desde_Noobai, etc.

  • Power Modes:

    • Modo_Safe: 1:1 Technical compatibility. Avoids errors without changing original colors.

    • Modo_Fuerte: Aggressive injection of color and blacks. Ideal for highlighting character designs.

    • Modo_Ultra: Brute power boost (1.50) for when a LoRA appears invisible.

    • Modo_Neutral: Deactivates color/energy bridge but keeps the Sharpening Injector active.

    • Puente_Inverso / Modo_Reverso: Swaps source and destination.

Advanced Prompt Example (Combo):

(masterpiece), 1girl, latex suit, detailed texture, <lora:StylePony:1>, 
fsn_native_flash, split_70, Hacia_SDXL, Modo_Fuerte

(This uses Native for 70% for anatomy, Flash at the end for texture, while translating a Pony LoRA to work strongly on an SDXL model).


Thanks so much for your support!