wangkanai/sdxl-fp16-loras-nsfw
<!-- README Version: v1.2 -->
SDXL FP16 LoRA Collection - NSFW
This repository contains a collection of FP16 precision LoRA (Low-Rank Adaptation) adapters for Stable Diffusion XL (SDXL) models, focused on NSFW (Not Safe For Work) content generation.
Model Description
LoRA adapters provide efficient fine-tuning of SDXL models by training only a small subset of parameters, enabling:
- Style Transfer: Apply specific artistic styles or aesthetic preferences
- Character Consistency: Maintain consistent character appearances across generations
- Concept Learning: Train on specific concepts, objects, or themes
- Memory Efficiency: Small file sizes (typically 10-500MB per LoRA)
- Composability: Stack multiple LoRAs for combined effects
Precision: FP16 (Float16) for balance between quality and file size Base Model: Stable Diffusion XL Base 1.0 Content: NSFW-focused LoRA adapters
Repository Contents
sdxl-fp16-loras-nsfw/
├── loras/
│ └── sdxl/ # SDXL LoRA adapters (.safetensors)
└── README.md # This fileModel Files
Status: Repository is currently empty. Model files will be added in .safetensors format.
Expected structure:
loras/sdxl/*.safetensors- Individual LoRA adapter files- Typical size: 10-500MB per LoRA file
- Format: SafeTensors (secure, efficient weight storage)
Hardware Requirements
VRAM Requirements
- Minimum: 8GB VRAM (with optimizations)
- Recommended: 12GB VRAM (comfortable generation)
- Optimal: 16GB+ VRAM (batch processing, multiple LoRAs)
Disk Space
- Per LoRA: 10-500MB (typical: 50-150MB)
- Recommended: 5GB+ for collection storage
System Requirements
- OS: Windows 10/11, Linux, macOS
- Python: 3.10+
- CUDA: 11.8+ (for NVIDIA GPUs)
- RAM: 16GB+ system RAM recommended
Usage Examples
Basic Usage with Diffusers
from diffusers import DiffusionPipeline
import torch
# Load base SDXL model
pipe = DiffusionPipeline.from_pretrained(
"stabilityai/stable-diffusion-xl-base-1.0",
torch_dtype=torch.float16,
variant="fp16"
)
pipe.to("cuda")
# Load LoRA weights
lora_path = "E:/huggingface/sdxl-fp16-loras-nsfw/loras/sdxl/example_lora.safetensors"
pipe.load_lora_weights(lora_path)
# Generate image
prompt = "your prompt here"
image = pipe(
prompt=prompt,
num_inference_steps=30,
guidance_scale=7.5,
cross_attention_kwargs={"scale": 0.8} # LoRA strength (0.0-1.0)
).images[0]
image.save("output.png")Multiple LoRA Loading
# Load multiple LoRAs with different strengths
pipe.load_lora_weights(
"E:/huggingface/sdxl-fp16-loras-nsfw/loras/sdxl/style_lora.safetensors",
adapter_name="style"
)
pipe.load_lora_weights(
"E:/huggingface/sdxl-fp16-loras-nsfw/loras/sdxl/character_lora.safetensors",
adapter_name="character"
)
# Set adapter weights
pipe.set_adapters(["style", "character"], adapter_weights=[0.7, 0.8])
# Generate with combined LoRAs
image = pipe(prompt).images[0]Memory-Efficient Generation
# Enable memory optimizations
pipe.enable_model_cpu_offload()
pipe.enable_vae_slicing()
pipe.enable_attention_slicing()
# Generate with reduced memory footprint
image = pipe(
prompt,
num_inference_steps=25,
guidance_scale=7.5
).images[0]ComfyUI Integration
- Place LoRA files in:
ComfyUI/models/loras/ - In ComfyUI workflow:
- Add "Load LoRA" node
- Connect to model chain
- Set strength (0.0-1.0)
- Generate images
Automatic1111/Forge Integration
- Place LoRA files in:
stable-diffusion-webui/models/Lora/ - In prompt, use:
<lora:filename:strength> - Example:
beautiful portrait <lora:style_lora:0.8> - Adjust strength value (0.1-1.0) for effect intensity
Model Specifications
Architecture Details
- Base Architecture: SDXL (Stable Diffusion XL)
- Adapter Type: LoRA (Low-Rank Adaptation)
- Precision: FP16 (16-bit floating point)
- Format: SafeTensors
- Rank: Typically 8-128 (varies by LoRA)
- Alpha: Model-specific (check individual LoRA metadata)
Training Details
- Base Model: Stable Diffusion XL Base 1.0
- Resolution: 1024x1024 (SDXL native)
- Content Type: NSFW-focused training data
- Optimization: LoRA efficient fine-tuning
Supported Resolutions
- Native: 1024x1024
- Supported: 512x512 to 2048x2048
- Aspect Ratios: 1:1, 16:9, 9:16, 4:3, 3:4, and custom
Performance Tips
Optimization Strategies
- LoRA Strength: Start with 0.6-0.8, adjust based on results
- Inference Steps: 25-40 steps for quality (lower = faster)
- Guidance Scale: 7-9 for balanced results
- VAE Slicing: Enable for memory efficiency
- CPU Offload: Use for <12GB VRAM systems
Quality Improvements
- Use multiple LoRAs strategically (style + concept)
- Adjust strengths independently for fine control
- Combine with textual inversion embeddings
- Use high-quality prompts with detail keywords
- Enable xformers for faster generation (if available)
Memory Management
# Aggressive memory optimization
pipe.enable_model_cpu_offload()
pipe.enable_vae_tiling()
pipe.enable_attention_slicing(slice_size=1)
# Clear cache between generations
import gc
gc.collect()
torch.cuda.empty_cache()License
This repository follows the OpenRAIL++ License, which permits:
- Commercial Use: Yes, with responsibility requirements
- Redistribution: Yes, under same license terms
- Modification: Yes, derivative works allowed
- Attribution: Recommended but not required
Important Restrictions:
- May not be used to generate illegal content
- May not be used to harm, exploit, or deceive individuals
- Users are responsible for downstream applications
- Content warnings required for NSFW outputs
Full license: CreativeML Open RAIL++-M License
Content Warning
This repository contains adapters designed for NSFW (Not Safe For Work) content generation. Users must:
- Be 18+ years of age in their jurisdiction
- Comply with local laws regarding adult content
- Use responsibly and ethically
- Implement appropriate content filters in production systems
- Not generate illegal or harmful content
Citation
If you use these models in research or production, please cite:
@misc{sdxl-fp16-loras-nsfw,
title={SDXL FP16 LoRA Collection - NSFW},
author={Community Contributors},
year={2025},
publisher={Hugging Face},
howpublished={\url{https://huggingface.co/sdxl-fp16-loras-nsfw}}
}
@article{rombach2022stable,
title={High-Resolution Image Synthesis with Latent Diffusion Models},
author={Rombach, Robin and Blattmann, Andreas and Lorenz, Dominik and Esser, Patrick and Ommer, Bj{\"o}rn},
journal={CVPR},
year={2022}
}
@article{hu2021lora,
title={LoRA: Low-Rank Adaptation of Large Language Models},
author={Hu, Edward J and Shen, Yelong and Wallis, Phillip and Allen-Zhu, Zeyuan and Li, Yuanzhi and Wang, Shean and Wang, Lu and Chen, Weizhu},
journal={arXiv preprint arXiv:2106.09685},
year={2021}
}Related Resources
Official Documentation
Community Resources
Tools and Interfaces
- ComfyUI - Node-based interface
- Automatic1111 WebUI - Popular web interface
- SD.Next - Advanced fork with features
- InvokeAI - Professional interface
Support and Contact
For issues, questions, or contributions:
- Issues: Report on GitHub repository issues page
- Community: Hugging Face model discussions
- Updates: Watch repository for new LoRA additions
Repository Status: Empty - Awaiting model file additions
Last Updated: 2025-10-14
README Version: v1.2
