Downloads · 30 days
58
19% of all-time downloads
Amr292/mmlkcairo-sdxl-lora
mmlkcairo-sdxl-lora is a text-to-image model from Amr292. Use it when you need an image from a text prompt. It is set up for diffusers. The card lists the license as openrail++.
A style LoRA for SDXL that renders Mamluk-era Cairo architecture (1250–1517): weathered limestone, crenellated parapets, honeycomb (muqarnas) portal hoods, tiered minarets, carved domes on tall drums, keel arches. Tri…
Downloads · 30 days
58
19% of all-time downloads
All-time downloads
298
Public
Repo size
941 MB
Likes
0
Public
Click a slice to open those files.
.safetensors598 MB · 61%
From the Hugging Face model README
A style LoRA for SDXL that renders Mamluk-era Cairo architecture (1250–1517): weathered limestone,
crenellated parapets, honeycomb (muqarnas) portal hoods, tiered minarets, carved domes on tall drums, keel arches.
Trigger word: mmlkcairo.
Built in one day (23 Sep 2026) as a self-directed project: dataset collection, captioning, two training runs, and a controlled evaluation of hallucination, style proportions and style bleeding.
Recommended: v2/mmlkcairo_sdxl_v2-000002.safetensors at LoRA weight 0.8.
Rows = prompts, columns = base SDXL · v1 · v2 at weight 0.6 / 0.8 / 1.0. Rows marked NOTRIG have no trigger word (leak test).
import torch
from diffusers import StableDiffusionXLPipeline, AutoencoderKL
vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
pipe = StableDiffusionXLPipeline.from_pretrained(
"stabilityai/stable-diffusion-xl-base-1.0", vae=vae,
torch_dtype=torch.float16, variant="fp16").to("cuda")
pipe.load_lora_weights("Amr292/mmlkcairo-sdxl-lora",
weight_name="v2/mmlkcairo_sdxl_v2-000002.safetensors", adapter_name="mmlkcairo")
pipe.set_adapters("mmlkcairo", adapter_weights=0.8)
image = pipe("mmlkcairo, a mosque facade seen from street level, tall portal in the center, minaret on the right, afternoon sun",
negative_prompt="blurry, lowres, text, watermark, deformed",
num_inference_steps=25, guidance_scale=7.0).images[0]
Prompt with plain object words (facade, dome, minaret, portal, courtyard, interior) plus viewpoint and light. Don't add style words — the trigger carries the style.
Amr292/mamluk-cairo-style-dataset — 42 photos of 17 Mamluk buildings from Wikimedia Commons, each with its license and author recorded.
mmlkcairo, then names subject,
viewpoint, light and all clutter (cars, wires, loudspeakers, scaffolding). Style words (Mamluk, muqarnas,
ablaq, ornate, carved…) are banned and checked by script, so the style is learned by the trigger rather than
by plain words, and clutter stays promptable instead of appearing by itself.kohya sd-scripts, SDXL base 1.0, single Kaggle T4 (fp16). LoRA rank 16 / alpha 16, U-Net only, AdamW8bit, lr 1e-4 cosine, min-SNR γ=5, aspect-ratio bucketing, 10 repeats.
| Run | What changed | Steps | Result |
|---|---|---|---|
| v1 | — | 4 epochs × 420 | Style learned well by epoch 3, but leaked: "a mosque facade" without the trigger came out fully Mamluk. Every caption contained mosque/dome/minaret, so the model learned "mosque → Mamluk". |
| v2 | + 42 regularization images: each training caption with the trigger removed, rendered by base SDXL (prior preservation) | 3 epochs × 840 | Leak fixed. New side effect at full strength: yellow-green cast and over-dense ornament — the trigger absorbed the "real photo vs. base render" difference (warm light, texture) and exaggerated it. |
| v2 @ 0.8 | LoRA weight lowered at inference | — | Cast mostly gone, style kept. Selected. At 0.6 the style starts falling back to the base model (plain domes, neoclassical library). |
Only one variable changed between each step, so each difference in the grids can be attributed to it.
Same 7 prompts × 2 seeds (42, 7) through every model, so each row differs only by the LoRA:
Grids: v1 epochs · v1 vs v2 · strength sweep
| v1 ep3 | v2 ep2 @1.0 | v2 ep2 @0.8 | |
|---|---|---|---|
| Recognizable Mamluk vocabulary | good | good | good |
| Proportions (not overdone) | good | over-dense ornament | mostly good |
| No other styles bleeding in | good | good | good |
| No leak without trigger | fails | passes | passes |
| Color / realism | natural | strong yellow-green cast | mostly natural, slight warmth |
v2/mmlkcairo_sdxl_v2-00000{1,2}.safetensors, v2/mmlkcairo_sdxl_v2.safetensors — v2 checkpoints (ep2 recommended)mmlkcairo_sdxl-00000{1,2,3}.safetensors, mmlkcairo_sdxl.safetensors — v1 checkpointsv2/reg_images/ — the 42 regularization images and captionsevaluation*/ — all renders and grids · notebooks/ — every notebook used, in orderPhotos: Wikimedia Commons contributors — authors and licenses per image in the dataset's metadata.csv.
Base model: Stability AI (SDXL 1.0). VAE: madebyollin/sdxl-vae-fp16-fix. Trainer: kohya-ss/sd-scripts.
Author: Amr Mohammed · GitHub