--- license: mit language: - en base_model: - Wan-AI/Wan2.1-T2V-14B - black-forest-labs/FLUX.1-Kontext-dev --- # Model Card for Shura's NSFW collections A collection of models intended for NSFW content generation developed by Shura490(https://civitai.com/user/shura490) Note: By downloading or using the models, you agree to abide by local laws and be held accountable for any legal consequences on your own. You agree to never use the models to nudify or defame real human beings or else your d❤️❤️k will shrink by 3inches(8cm). And then you will be jailed. ## Model Details ### Model Description This collection of models(LoRA) are trained to produce nsfw image and video contents for research and personal entertainment purposes. I uploaded most of my work to https://civitai.com/user/shura490 and this repo is the backup. LoRA, or Low-Rank Adaptation, is a technique used in machine learning to make fine-tuning more efficient. Instead of retraining the entire model, LoRA freezes the original model's weights and adds small, trainable low-rank matrices to specific layers. text2image and text2video/image2video base models released by big corps ususally lack the capability of producing nsfw contents involving nudity or sex. And the LoRAs I train aim to bridge that gap. This is an interesting research topic for me personally to understand the process of teaching models new knowledge using fine-tuning techniques. Additionally, models with NSFW knowledge usually also perform better in other tasks due to its enriched knowledge of human body anatomy, hence it's not strictly just a "porn generator". - **Developed by:** Shura490 - **Model type:** LORA - **License:** mit, you may freely merge and use the models in this repo. Note: generated contents still subject to base model's license - **Finetuned from model:** WAN2.1, Flux.1 Kontext Dev, etc. To contact the author, find Shura490 in NSFW-API's official discord where the author is currently active: https://huggingface.co/NSFW-API Sample image (Generated with Chroma): ![image/png](/static-proxy?url=https%3A%2F%2Fcdn-uploads.huggingface.co%2Fproduction%2Fuploads%2F68652a3b0b1de9675c4c2211%2Fo6NAi74g5Pjwi24TFEVME.png) Result image censored: ![image/jpeg](/static-proxy?url=https%3A%2F%2Fcdn-uploads.huggingface.co%2Fproduction%2Fuploads%2F68652a3b0b1de9675c4c2211%2FtdNVufBiln6I5pZgy2tiA.jpeg) ## Uses WIP The change_clothes_to_nothing lora is intended to remove clothing from AI generated characters to produce NSFW entertainment contents. To use it, apply the LoRA change_clothes_to_nothing to the base Flux.1 Kontext Dev model, and prompt it with "Change clothes to nothing", "Change all their clothes to nothing", "Remove clothes", etc. which may give slightly different results each time. Recommended guidance is 0.9 to 2.5. Multiple hand-picked epochs are provided each with slightly differences. ### How to Get Started with the Model Recommend using ComfyUI's official Flux.1 Kontext Dev workflow with load Lora node ## Bias, Risks, and Limitations Please check your local law and legislation before downloading and using the models. Due to the nature of the model, this may get taken down at any time. And please do not reach out to the author if it ever gets taken down. The model is trained on AI generated images from Pony, Chroma and SD1.5 of realistic and Anime/3D nude women of East Asian/Caucasian origins and according to the author's preference. So it may not produce good results on other ethnicities, and the author will not respond to requests about updating the dataset unless you are willing to do the work. ## Flux.1 Kontext Dev LoRa Training Guide ### Training Procedure Flux Kontext LoRA is now easier to train than regular Flux1.d LoRA given Kontext model's even more baseline capabilities and the fact you virtually do not need any captioning of images. I recommend a new workflow that uses only synthetic data for NSFW concepts: 1. Assemble a dataset that contains the NSFW concept you want, e.g. nudity, body type, position of sex 2. Use the base Kontext model to transform the original image into SFW ones. Despite that the base model is not able to convert SFW images to NSFW ones, it can do the inverse pretty well. For example, to train a "sexy lingerie wear" LoRA, you can dress the character generated with the desirable garments, with simply random SFW wear, like jackets, gowns, and shirts. Then the original image would be your control image, and the modified ones will be the source. 3. Caption the control images with the concept you want, for example "Change the clothes to sexy lingerie". Note you do not need any other description of the image given the nature of Kontext is just image editing, and this will save you huge amount of time. I recommend using AI-toolkits for training: https://github.com/ostris/ai-toolkit/blob/main/README.md Because of the simplicity of this training flow, most of the dataset assembly can be automated completely with fully synthetic data without worrying about the impact on LoRA quality, and you only have to ensure your target/control is good enough without worrying much about the source image. Example source data, target data skipped. ![image/png](/static-proxy?url=https%3A%2F%2Fcdn-uploads.huggingface.co%2Fproduction%2Fuploads%2F68652a3b0b1de9675c4c2211%2F43bJRnQuaHINJDgYN0AC2.png) ![image/png](/static-proxy?url=https%3A%2F%2Fcdn-uploads.huggingface.co%2Fproduction%2Fuploads%2F68652a3b0b1de9675c4c2211%2FwH4losQkJqT7HakNFwgiJ.png) #### Training Params ``` --- job: "extension" config: name: "change_clothes_to_nothing" process: - type: "ui_trainer" training_folder: "/home/xxx/ai-toolkit/output" sqlite_db_path: "./aitk_db.db" device: "cuda" trigger_word: null performance_log_every: 10 network: type: "lora" linear: 32 linear_alpha: 32 conv: 16 conv_alpha: 16 lokr_full_rank: true lokr_factor: -1 network_kwargs: ignore_if_contains: [] save: dtype: "bf16" save_every: 800 max_step_saves_to_keep: 4 save_format: "diffusers" push_to_hub: false datasets: - folder_path: "/home/xxx/ai-toolkit/datasets/nudify_target" control_path: "/home/xxx/ai-toolkit/datasets/nudify_source" mask_path: null mask_min_value: 0.1 default_caption: "" caption_ext: "txt" caption_dropout_rate: 0.05 cache_latents_to_disk: false is_reg: false network_weight: 1 resolution: - 512 - 768 - 1024 controls: [] train: batch_size: 1 bypass_guidance_embedding: false steps: 14000 gradient_accumulation: 1 train_unet: true train_text_encoder: false gradient_checkpointing: true noise_scheduler: "flowmatch" optimizer: "adamw8bit" timestep_type: "weighted" content_or_style: "balanced" optimizer_params: weight_decay: 0.0001 unload_text_encoder: false lr: 0.00006 ema_config: use_ema: false ema_decay: 0.99 dtype: "bf16" diff_output_preservation: false diff_output_preservation_multiplier: 1 diff_output_preservation_class: "person" model: name_or_path: "black-forest-labs/FLUX.1-Kontext-dev" quantize: true quantize_te: true arch: "flux_kontext" low_vram: false model_kwargs: {} sample: sampler: "flowmatch" sample_every: 800 width: 1024 height: 1024 prompts: - "change clothes to nothing --ctrl_img /home/xxx/ai-toolkit/datasets/nudify_test/00051-420993424.png" - "change clothes to nothing --ctrl_img /home/xxx/ai-toolkit/datasets/nudify_test/SXJ38H49B5BYKGD8Q60FDXM5S0.jpeg" neg: "" seed: 42 walk_seed: true guidance_scale: 2.5 sample_steps: 20 num_frames: 1 fps: 1 meta: name: "[name]" version: "1.0" ``` #### Hardware Trained on my personal RTX 6000 PRO 96GB for 15 hours