👋 If you like what I do and want to support the development, feel free to buy me a coffee:
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.
Step 1: Drop the
.pyfiles into yourmodulesfolder.Step 2: Open
modules/sd_schedulers.pyand add this line at the very end:import modules.sd_agga_schedulersStep 3: Open
modules/sd_samplers_kdiffusion.pyand 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.10to 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-> Upscalenearest) 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:
DNA Detection (Step 0): It measures the energy of the base model (checking if it's Velvette, Illustrious, etc.).
Synchronization: If it detects a direction command (e.g.,
Hacia_Velvette), it adjusts the contrast and color so that the LoRA feels "at home."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! ♥
Description
FAQ
Comments (4)
Is A1111 (v2) compatible with Forge? I'm using Forge Neo
Do you have more descriptions of the newer sampler/schedulers?
1. Dictionary of AGGA Samplers
These algorithms decide how the image is calculated step-by-step.
Category: Pseudo-HiRes & Detail
AGGA Pseudo-HiRes Soft:
Function: Base version. Performs a standard Euler step.
Use: Smooth, clean images without aggressive artifacts.
AGGA Pseudo-HiRes Sharp:
Function: Introduces a multiplier (1.12 boost) after 65% of the steps.
Use: Artificially increases sharpness at the end of the generation.
AGGA Pseudo-HiRes Ultra:
Function: Applies progressive reinforcement (from 1.18 upwards) after 55% of the steps.
Use: For heavily marked textures or "crisp" styles.
AGGA Pseudo-HiRes Flash v2 (Better: 16 steps):
Function: Optimized for low steps. Applies strong DPM correction at the start and a smooth boost at the end.
Use: Fast generations that need to avoid looking blurry.
AGGA-Detail-Native:
Function: Uses edge detection (calculating dx and dy gradients). If it detects complex textures, it injects refined noise.
Use: Recovering pores, fur, and realistic textures.
AGGA-Structural-Detail:
Function: Hybrid. The first half (45%) uses DPM++ 2M (best for structure/anatomy) and the second half uses the AGGA detail engine.
Use: The best balance between correct anatomy and high-definition textures.
Category: Style Repair
AGGA Style-Repair Ultra:
Function: Splits the process into "Sketching" and "Studio" phases. Uses a "contrast bias" to recover 3D volume and applies adaptive sharpening.
Use: To save images that look "washed out" or flat due to aggressive merges.
AGGA Style-Repair (Prompt-Aware):
Function: Advanced. Attempts to read the hidden "unconditional" noise versus the "conditional" to extract a "Style Force Vector".
Use: Forces the model to follow the prompt's style much more strictly than normal CFG.
Category: Bridges & LORA (Pony/SDXL)
AGGA Lora Bridge (Series):
Variants: Normal, Stable, Sharp, Ultra-Sharp.
Function: "Translates" tensor statistics (mean and standard deviation). Injects mathematical "DNA" from models like Pony V6 into other models.
Use: Using Pony LoRAs on normal SDXL (or vice versa) without the image breaking or burning.
AGGA Universal Bridge:
Function: Automatically detects commands in your prompt (e.g., hacia_pony, modo_fuerte). Adjusts image "temperature" and vibrancy dynamically.
Use: The ultimate tool for mixing incompatible resources.
Category: Specials
AGGA DMD-Turbo Landing:
Function: Designed for LCM/DMD2 guides (4-8 steps). Features a "landing" phase that forces convergence to the clean image.
Use: Ultra-fast generation.
AGGA Pixel-Master:
Function: In the last step, applies a spatial resize (Downscale area -> Upscale nearest) to create perfect blocks.
Use: Authentic pixel art (SNES/NES style) without external post-processing.
2. Dictionary of AGGA Schedulers
These algorithms dictate the pacing of the noise (sigmas).
AGGA DMD Power: Aggressive power curve (rho=7). For Turbo (4-8 steps).
AGGA Log-Linear: Perfect logarithmic distribution. Ideal for the Detail-Native sampler.
AGGA Dynamic Rho: Changes the power curve (from 5 to 9) during generation. Maximum stability over many steps.
AGGA Style-Anchor / Ultra-Anchor: "Anchors" (slows down) the process in the middle sigmas (where style is defined), forcing the sampler to work harder there.
AGGA Double-Anchor: Features three time warps: Style, Eye Sniper, and DMD Tail. Very complex, intended for portraits.
AGGA Pixel Staircase (v1/v2): Creates a "staircase" where noise stays the same for multiple steps. This is vital so pixel art doesn't get smoothed out.
AGGA UNIVERSAL BRIDGE: Warped curve specifically designed to accompany the Universal Bridge sampler.
3. Recommended
👑 Realism: AGGA-Structural-Detail
Why: Combines the anatomical correction of DPM++ 2M (which prevents mutations) with AGGA's pore/skin texture.
Ideal Scheduler: AGGA Log-Linear or AGGA Dynamic Rho.
🎨 Style/Art: AGGA Style-Repair Ultra
Why: Recovers lighting, volume, and contrast in flat models (anime/2.5D).
Ideal Scheduler: AGGA Style-Ultra (The "Ultra-Ultra" combination is designed to work together).
🛠️ AGGA Universal Bridge
Why: Allows you to use Pony Diffusion LoRAs on normal SDXL models (like Juggernaut) by writing hacia_pony in the prompt.
Ideal Scheduler: AGGA UNIVERSAL BRIDGE.
⚡ Speed (Turbo/LCM): AGGA DMD-Turbo Landing
Why: Converges in 6-8 steps without the residual noise left by normal samplers.
Ideal Scheduler: AGGA DMD Power.
4. Compatibility (Winning Combinations)
High Realism:Structural-Detail -> Dynamic Rho -> Solid anatomy, detailed skin.
Skin/Pores:Detail-Native -> Log-Linear -> Total focus on micro-texture.
Style Rescue:Style-Repair -> UltraStyle-Ultra -> Recovers backgrounds and light effects.
Pixel Art:Pixel-Master -> Pixel Staircase v2 -> Crucial: The scheduler prevents smoothing.
LoRAs:Universal Bridge -> AGGA UNIVERSAL BRIDGE -> Activates prompt commands.
Turbo (8 steps):DMD-Turbo Landing -> AGGA DMD Power -> For Lightning/DMD2 models.
5. Differences from Classic (Original) Samplers
Image Awareness:
Classics (Euler, Heun): Purely mathematical. They do not "see" the image.
AGGA: Uses edge detection algorithms (dx, dy in the code) in real-time. If they see an edge, they change noise behavior only in that zone.
Energy Management (Anti-Grey):
Classics: Sometimes generate washed-out (greyish) images if CFG is high or the model is poor.
AGGA: Features "Energy Floors." If they detect standard deviation dropping below 0.90, they mathematically inject contrast to revive the image.
Bridging:
Classics: If you use a Pony LoRA on SDXL, the image burns (fries).
AGGA (Bridge): Normalizes tensors to make them compatible.
6. Hybrid Compatibility (AGGA + Classics)
If you prefer mixing with what you already know, here is what works best:
AGGA Sampler + Classic Scheduler:
Using AGGA Structural-Detail with the Karras scheduler (classic) yields excellent, very predictable results. Karras softens the aggressiveness of AGGA's detail.
AGGA Universal Bridge works very well with Exponential (classic) for clean anime styles.
Classic Sampler + AGGA Scheduler:
Using DPM++ 2M SDE (classic) with AGGA Dynamic Rho creates incredible stability at high steps (30-60 steps), preventing the image from shifting or "hallucinating" details at the end.
Using Euler a (classic) with AGGA Style-Anchor allows Euler more time to be creative in the mid-range, improving composition without changing the sampler.















