Instructions to use Ironictw2st/tk_3k_portraits with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Ironictw2st/tk_3k_portraits with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("Ironictw2st/tk_3k_portraits") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
TW3K Portrait LoRA (tk3k_portrait)
An SDXL LoRA that generates Total War: THREE KINGDOMS–style character portraits in the look of the SAD modpack art. Use it to create new in-style hero/officer portraits on a clean near-white background, ready for upscaling, background removal, or export into the mod's character art structure.
- Base model: stabilityai/stable-diffusion-xl-base-1.0 (required)
- Type: LoRA adapter for SDXL
- Trigger word:
tk3k_portrait - App / full pipeline (web UI + export tools): https://github.com/Ironictw2st/tkart-portrait-generator
⚠️ Non-commercial fan content. This LoRA was trained on art from the Total War: THREE KINGDOMS SAD modpack. The game and its assets belong to their respective owners. Released under CC BY-NC 4.0 — personal / non-commercial use only. See License.
Files
| File | Size | Notes |
|---|---|---|
tk3k_portrait_v3.safetensors |
~436 MB | Recommended — final epoch (v3). This is the default. |
Download the file and (if you're using the companion app)
place it at output/v3/tk3k_portrait_v3.safetensors.
Usage
Easiest: the web app
Use the TW3K Portrait Generator — a local Gradio UI with generation, upscaling, background removal, and mod-export built in. Follow its README to set up.
Directly with 🧨 diffusers
import torch
from diffusers import StableDiffusionXLPipeline, EulerAncestralDiscreteScheduler
pipe = StableDiffusionXLPipeline.from_pretrained(
"stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16,
).to("cuda")
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
# Load the LoRA from this repo
pipe.load_lora_weights("Ironictw2st/tk_3k_portraits",
weight_name="tk3k_portrait_v3.safetensors")
prompt = (
"tk3k_portrait, solo, (full body:1.5), (full length:1.4), head to toe, "
"standing, feet visible, man, lightly armored, "
"flowing silk scholar robe, official's cap, dignified expression, "
"full body portrait, (plain white background:1.4), simple background, "
"isolated on white background"
)
negative = (
"bust portrait, headshot, half body, cropped, close-up, waist up, "
"multiple poses, reference sheet, multiple views, multiple characters, "
"low quality, blurry, jpeg artifacts, signature, text, watermark, "
"deformed, extra limbs, background, scenery, wall, weapon, sword"
)
image = pipe(
prompt, negative_prompt=negative,
num_inference_steps=30, guidance_scale=6.5,
width=832, height=1216, # portrait aspect → full-body framing
cross_attention_kwargs={"scale": 1.0}, # LoRA weight
).images[0]
image.save("portrait.png")
Prompting guide
- Always start the prompt with the trigger:
tk3k_portrait. - Then describe:
man/woman→ armor (unarmored/lightly armored/heavily armored) → free description (robes, cap, beard, expression, colors). - Full-body figures: add framing cues like
solo, (full body:1.5), (full length:1.4), head to toe, standing, feet visibleand render at 832×1216 (portrait). For a bust, drop those and use 1024×1024. - Clean background: end with
full body portrait, (plain white background:1.4), simple background, isolated on white background. The model reliably produces a near-white background, which makes background removal easy. - Color, not literal elements: to evoke a Wuxing element, describe a palette (e.g. "deep red and gold robes") rather than tags like "fire" — element tags tend to render literal flames/water/VFX.
Recommended settings
| Setting | Value |
|---|---|
| Sampler / scheduler | Euler Ancestral (EulerAncestralDiscreteScheduler) |
| Steps | 30 |
| CFG | 6.5 |
| LoRA weight | 1.0 |
| Resolution | 832×1216 (full body) or 1024×1024 (bust) |
Training
- Base: Stable Diffusion XL 1.0
- Data: portraits from the Total War: THREE KINGDOMS SAD modpack, composited on white
- Method: LoRA fine-tune (kohya / sd-scripts).
v3is the final checkpoint.
License
Released under Creative Commons Attribution–NonCommercial 4.0 (CC BY-NC 4.0).
- ✅ Share and use for personal, non-commercial purposes, with attribution.
- ❌ No commercial use.
- This adapter also requires and runs on SDXL 1.0, whose CreativeML Open RAIL++-M use-based restrictions also apply.
- The underlying art style derives from Total War: THREE KINGDOMS and the SAD modpack; this is unofficial fan content and not affiliated with or endorsed by their owners.
Credits
- Base model: Stability AI — Stable Diffusion XL 1.0
- Art style: Total War: THREE KINGDOMS SAD modpack (© respective owners)
- App & tooling: https://github.com/Ironictw2st/tkart-portrait-generator
- Downloads last month
- 3
Model tree for Ironictw2st/tk_3k_portraits
Base model
stabilityai/stable-diffusion-xl-base-1.0