Downloads · 30 days
15
6% of all-time downloads
aaronw122/prtkl-sdxl-lora
prtkl-sdxl-lora is a text-to-image model from aaronw122. Use it when you need an image from a text prompt. It is set up for diffusers. The card lists the license as apache-2.0.
A fine-tuned SDXL LoRA that generates particle art — human figures composed of sparse black dots on white backgrounds.
Downloads · 30 days
15
6% of all-time downloads
All-time downloads
260
Public
Repo size
93.1 MB
Likes
0
Public
Click a slice to open those files.
.safetensors93.1 MB · 100%
From the Hugging Face model README
A fine-tuned SDXL LoRA that generates particle art — human figures composed of sparse black dots on white backgrounds.
import torch
from diffusers import AutoencoderKL, DiffusionPipeline
from safetensors.torch import load_file
# Load pipeline
vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
pipe = DiffusionPipeline.from_pretrained(
"stabilityai/stable-diffusion-xl-base-1.0",
vae=vae,
torch_dtype=torch.float16,
variant="fp16",
).to("cuda")
# Load LoRA weights
pipe.load_lora_weights("aaronw122/prtkl-sdxl-lora", weight_name="pytorch_lora_weights.safetensors")
# Load textual inversion embeddings
from huggingface_hub import hf_hub_download
ti_path = hf_hub_download("aaronw122/prtkl-sdxl-lora", "results_emb.safetensors")
state_dict = load_file(ti_path)
pipe.load_textual_inversion(state_dict["clip_l"], token=["<s0>", "<s1>"], text_encoder=pipe.text_encoder, tokenizer=pipe.tokenizer)
pipe.load_textual_inversion(state_dict["clip_g"], token=["<s0>", "<s1>"], text_encoder=pipe.text_encoder_2, tokenizer=pipe.tokenizer_2)
# Generate
image = pipe(
"<s0><s1>, a figure dancing with arms raised, white background",
negative_prompt="photorealistic, detailed, shading, gradient, gray, color, dense",
num_inference_steps=30,
guidance_scale=5.0,
).images[0]
image.save("particle_art.png")
<s0><s1> (mapped from prtkl)<s0><s1>,"photorealistic, detailed, shading, gradient, gray, color, dense, beige, tan, sepia"