Downloads · 30 days
0
wangkanai/flux-dev-loras-nsfw
flux-dev-loras-nsfw is a text-to-image model from wangkanai. 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.
- Comprehensive repository analysis and validation - Confirmed empty repository status (22KB, awaiting LoRA files) - Verified YAML frontmatter compliance with Hugging Face standards - Validated all documentation secti…
Downloads · 30 days
0
Access
Public
Updated Oct 28, 2025
Repo size
—
Likes
1
Public
Click a slice to open those files.
.md18.8 KB · 93%
From the Hugging Face model README
license: apache-2.0 as specified in requirementslicense_name field (not required for standard licenses)base_model and base_model_relation fields (not applicable for LoRA collections)This repository contains a collection of LoRA (Low-Rank Adaptation) adapters for FLUX.1-dev models, focused on specialized content generation. LoRA adapters provide efficient fine-tuning by adding small trainable parameters to the base model, enabling style variations, character customization, and domain-specific generation without modifying the original model weights.
Key Capabilities:
flux-dev-loras-nsfw/
├── loras/
│ └── flux/
│ └── [LoRA model files will be stored here]
└── README.md (this file)
Current Status: Repository structure initialized, awaiting model files.
Expected File Types:
.safetensors - LoRA adapter weights (recommended format).json - LoRA configuration metadata.txt - Trigger words and usage instructionsTypical LoRA Sizes:
Current: 22 KB (empty structure) Expected: Varies based on LoRA collection (typically 100MB - 5GB total)
Minimum Requirements:
Recommended Setup:
LoRA-Specific Benefits:
from diffusers import FluxPipeline
import torch
# Load base FLUX.1-dev model
pipe = FluxPipeline.from_pretrained(
"E:\\huggingface\\flux-dev-fp16", # Your local FLUX.1-dev path
torch_dtype=torch.float16
)
pipe.to("cuda")
# Load LoRA adapter
pipe.load_lora_weights(
"E:\\huggingface\\flux-dev-loras-nsfw\\loras\\flux",
weight_name="your_lora.safetensors",
adapter_name="custom_style"
)
# Generate with LoRA
prompt = "your prompt with trigger words"
image = pipe(
prompt=prompt,
num_inference_steps=30,
guidance_scale=7.5,
height=1024,
width=1024
).images[0]
image.save("output.png")
# Load multiple LoRAs
pipe.load_lora_weights(
"E:\\huggingface\\flux-dev-loras-nsfw\\loras\\flux",
weight_name="style_lora.safetensors",
adapter_name="style"
)
pipe.load_lora_weights(
"E:\\huggingface\\flux-dev-loras-nsfw\\loras\\flux",
weight_name="character_lora.safetensors",
adapter_name="character"
)
# Set adapter weights for blending
pipe.set_adapters(["style", "character"], adapter_weights=[0.8, 0.6])
# Generate with combined LoRAs
image = pipe(prompt="your combined prompt").images[0]
# Unload current LoRA
pipe.unload_lora_weights()
# Load different LoRA
pipe.load_lora_weights(
"E:\\huggingface\\flux-dev-loras-nsfw\\loras\\flux",
weight_name="different_lora.safetensors"
)
# Generate with new style
image = pipe(prompt="new prompt").images[0]
1. Place LoRA files in: ComfyUI/models/loras/
2. In ComfyUI workflow:
- Add "Load LoRA" node
- Connect to your FLUX.1-dev model
- Set strength: 0.6-1.0 (adjust for desired effect)
- Add trigger words to your prompt
Format: SafeTensors (recommended for security and efficiency)
Rank: Varies by LoRA (typical range: 4-128)
Precision Options:
Base Model Compatibility:
LoRAs in this collection are typically trained with:
Fast Switching:
# Keep base model loaded, only swap LoRAs
pipe.unload_lora_weights() # Fast
pipe.load_lora_weights(...) # Fast
# Much faster than reloading entire base model
Memory Management:
pipe.unload_lora_weights() when switching stylesWeight Adjustment:
Combining LoRAs:
Prompt Engineering with LoRAs:
(trigger word:1.2) for stronger effectTrigger Word Strategies:
# Basic trigger word usage
prompt = "anime style, portrait of a character" # Generic
# Optimized with LoRA trigger words
prompt = "anime_style_v2, detailed portrait, character design" # LoRA-specific
Weight and Emphasis Techniques:
Standard: "beautiful landscape"
Emphasized: "(beautiful:1.3) landscape"
De-emphasized: "(background:0.7) focus on subject"
LoRA trigger: "(anime_style:1.2) detailed character"
Multi-LoRA Prompt Structure:
[Style LoRA trigger words] [Subject description] [Character LoRA trigger words] [Scene details]
Example:
"cinematic_lighting, fantasy_style, portrait of warrior, heroic_pose, detailed armor, misty forest background"
Negative Prompt Optimization:
negative_prompt = """
low quality, blurry, distorted, deformed, artifacts,
watermark, signature, text, bad anatomy, overexposed
"""
# Use negative prompts to avoid common LoRA artifacts
Context Length Management:
Optimal Settings:
Quality Troubleshooting:
Issue: LoRA not affecting output
Issue: Out of Memory (OOM) errors
pipe.unload_lora_weights()pipe.enable_model_cpu_offload()Issue: Generation artifacts or distortion
Issue: Slow generation with LoRA
Issue: LoRA file won't load
.safetensors (preferred)adapter_name parameterThis LoRA collection works with local FLUX.1-dev installations:
# FP16 precision (highest quality)
base_model = "E:\\huggingface\\flux-dev-fp16"
# FP8 precision (memory efficient)
base_model = "E:\\huggingface\\flux-dev-fp8"
# Load base model + LoRA
pipe = FluxPipeline.from_pretrained(base_model, torch_dtype=torch.float16)
pipe.load_lora_weights("E:\\huggingface\\flux-dev-loras-nsfw\\loras\\flux", ...)
FP16 Base Model:
FP8 Base Model:
Development Workflow:
# 1. Initial setup - load base model once
pipe = FluxPipeline.from_pretrained(
"E:\\huggingface\\flux-dev-fp16",
torch_dtype=torch.float16
).to("cuda")
# 2. Iterative LoRA testing
for lora_file in ["style1.safetensors", "style2.safetensors", "style3.safetensors"]:
pipe.unload_lora_weights() # Fast cleanup
pipe.load_lora_weights(
"E:\\huggingface\\flux-dev-loras-nsfw\\loras\\flux",
weight_name=lora_file
)
image = pipe(prompt).images[0]
image.save(f"output_{lora_file}.png")
Batch Generation Pipeline:
import itertools
# Test multiple LoRAs with multiple prompts
loras = ["anime_v1.safetensors", "realistic_v2.safetensors"]
prompts = ["portrait of character", "landscape scene", "action pose"]
strengths = [0.6, 0.8, 1.0]
for lora, prompt, strength in itertools.product(loras, prompts, strengths):
pipe.unload_lora_weights()
pipe.load_lora_weights(
"E:\\huggingface\\flux-dev-loras-nsfw\\loras\\flux",
weight_name=lora
)
pipe.set_adapters([lora.split('.')[0]], adapter_weights=[strength])
image = pipe(prompt, num_inference_steps=28).images[0]
image.save(f"batch_{lora}_{strength}_{prompt[:10]}.png")
Production Inference Optimization:
# Enable torch.compile for PyTorch 2.0+
pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)
# Enable attention slicing for lower VRAM
pipe.enable_attention_slicing()
# Use VAE tiling for high-res generation
pipe.vae.enable_tiling()
# Generate with optimizations
image = pipe(
prompt=prompt,
num_inference_steps=28,
guidance_scale=3.5,
generator=torch.manual_seed(42) # Reproducible results
).images[0]
LoRA Collection License: Varies by individual LoRA (check metadata)
Base Model License: FLUX.1 Community License (non-commercial use)
Usage Restrictions:
@article{flux2024,
title={FLUX.1: A New Generation of Diffusion Models},
author={Black Forest Labs},
journal={Technical Report},
year={2024},
url={https://blackforestlabs.ai/flux-1}
}
@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}
}
| Base Model | Precision | VRAM Required | LoRA Compatibility | Performance |
|---|---|---|---|---|
| FLUX.1-dev | FP16 | 11-13 GB | ✅ Full | Best quality |
| FLUX.1-dev | FP8 | 6-8 GB | ✅ Full | Good quality |
| FLUX.1-schnell | FP16 | 11-13 GB | ⚠️ Partial | Fast inference |
| FLUX.1-schnell | FP8 | 6-8 GB | ⚠️ Partial | Very fast |
Notes:
Minimum Requirements:
diffusers >= 0.30.0
transformers >= 4.44.0
torch >= 2.0.0
safetensors >= 0.4.0
accelerate >= 0.23.0
Recommended for Best Performance:
diffusers >= 0.31.0
transformers >= 4.45.0
torch >= 2.4.0 (with CUDA 12.1+)
xformers >= 0.0.22 (optional, for memory efficiency)
Installation Command:
pip install diffusers>=0.30.0 transformers>=4.44.0 torch>=2.0.0 safetensors accelerate
Supported Formats:
.safetensors - Primary format (recommended).bin - PyTorch format (legacy, less secure).pt - Legacy format (test before use).ckpt - Not supported (Stable Diffusion format)Format Conversion:
from safetensors.torch import save_file, load_file
# Convert .bin to .safetensors
state_dict = torch.load("lora.bin", map_location="cpu")
save_file(state_dict, "lora.safetensors")
When adding new LoRA files to this repository:
.safetensors files in loras/flux/anime_style_v2.safetensors).txt file with trigger words and settings.json config if availableSubdirectory Structure (for large collections):
loras/flux/
├── characters/ # Character-specific LoRAs
├── styles/ # Artistic style adapters
├── concepts/ # Concept/theme LoRAs
└── quality/ # Quality enhancement LoRAs
File Naming:
style_name_v1.safetensorscharacter_r64.safetensors (if relevant)Current Status: Repository initialized, awaiting model files
Directory Structure:
Disk Usage:
README Version: v1.5
Last Updated: 2025-10-28
Maintained by: Local AI Model Collection
Repository Path: E:\huggingface\flux-dev-loras-nsfw