Run this model with HF Jobs
Run ItsMaxNorm/diffusion-p on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/ItsMaxNorm/diffusion-p. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/ItsMaxNorm/diffusion-p on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use ItsMaxNorm/diffusion-p with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use ItsMaxNorm/diffusion-p with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("ItsMaxNorm/diffusion-p", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Improve model card and add metadata
#1
by nielsr HF Staff - opened
123---license: apache-2.0---1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162---license: apache-2.0library_name: diffuserspipeline_tag: text-to-image---# SafeDiffusion-R1: Online Reward Steering for Safe Diffusion Post-TrainingSafeDiffusion-R1 is a safety post-training framework for Stable Diffusion based on Group Relative Policy Optimization (GRPO). It uses a closed-form, CLIP-based steering reward to bake safety priors directly into the UNet weights, eliminating the need for separately trained safety classifiers or inference-time interventions.[**Project Page**](https://maxnorm8650.github.io/SafeDiffusion-R1/) | [**GitHub**](https://github.com/MAXNORM8650/SafeDiffusion-R1) | [**Paper**](https://huggingface.co/papers/2605.18719)## Model VariantsThe models are released as full Diffusers pipelines in different subfolders:| Subfolder | Description ||---|---|| `scaled` | Main paper checkpoint. Best balance of safety and utility (Default). || `compact` | Optimized for lowest MMA-Diffusion ASR (adversarial robustness). || `empty-positive` | Ablation variant trained without safe anchors. |## Sample UsageYou can load and use the model variants using the `diffusers` library. Since the repository uses subfolders for different variants, we recommend using `snapshot_download` to load the specific version you need.```pythonfrom huggingface_hub import snapshot_downloadfrom diffusers import StableDiffusionPipelineimport os, torch# Download the variant you want (e.g., "scaled")local_root = snapshot_download("ItsMaxNorm/SafeDiffusion-R1",allow_patterns="scaled/*", # or "compact/*" / "empty-positive/*")# Load the pipelinepipe = StableDiffusionPipeline.from_pretrained(os.path.join(local_root, "scaled"),torch_dtype=torch.float16,).to("cuda")# Generate an imageprompt = "a photo of a cat sleeping on a couch"img = pipe(prompt).images[0]img.save("out.png")```## Citation```bibtex@misc{kumar2026safediffusionr1,title={SafeDiffusion-R1: Online Reward Steering for Safe Diffusion Post-Training},author={Komal Kumar and Ankan Deria and Abhishek Basu and Fahad Shamshad and Hisham Cholakkal and Karthik Nandakumar},year={2026},eprint={2605.18719},archivePrefix={arXiv},primaryClass={cs.CV},url={https://arxiv.org/abs/2605.18719},}```
README.md+62-3