Run this model with HF Jobs
Run RISHIKAMASHETTY/diffusion-models 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/RISHIKAMASHETTY/diffusion-models. 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/RISHIKAMASHETTY/diffusion-models 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 RISHIKAMASHETTY/diffusion-models with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use RISHIKAMASHETTY/diffusion-models with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("RISHIKAMASHETTY/diffusion-models", 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
File size: 5,386 Bytes
4c7d075 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | # SDXL-Inpainting LoRA - damaged Indian painting restoration
Pipeline: damaged image -> YOLOv8s-seg mask -> `diffusers/stable-diffusion-xl-1.0-inpainting-0.1` + LoRA (train/infer 768px) -> composite at 512px.
Same split, masks, eval images and metrics as the SD-1.5 run (`sd-1.5`); only the diffusion backbone differs.
Folders: `lora/` (weights), `data/` (split manifests), `results/` (`*_full_val_*` metrics on all val images, FID/KID, paired comparison, grids), `config.json`.
Train/val image archives: dataset repo `RISHIKAMASHETTY/diffusion-restoration-data`.
Metric rules: PSNR is infinite for outputs identical to the original (images without damage) and is averaged over finite values only;
masked metrics (psnr_masked, mae_masked) cover images with a non-empty GT damage mask. All damage is synthetic.
## SDXL full-val metrics (455 images, 512px)
| | baseline_damaged | sdxl_gt_mask | sdxl_yolo_mask |
|:------------------------|-------------------:|---------------:|-----------------:|
| psnr_mean | 25.7173 | 29.2984 | 29.38 |
| psnr_std | 6.3346 | 7.0307 | 7.0203 |
| ssim_mean | 0.9553 | 0.9568 | 0.9574 |
| ssim_std | 0.0577 | 0.0578 | 0.0571 |
| lpips_mean | 0.062 | 0.0268 | 0.028 |
| lpips_std | 0.0698 | 0.04 | 0.0412 |
| psnr_masked_mean | 9.115 | 14.9486 | 14.7722 |
| psnr_masked_std | 5.2065 | 4.4671 | 6.1925 |
| mae_masked_mean | 78.8064 | 34.5409 | 35.8809 |
| mae_masked_std | 21.4513 | 15.9948 | 16.0827 |
| psnr_median | 24.9115 | 28.5442 | 28.608 |
| n_images | 455 | 455 | 455 |
| n_with_damage | 442 | 442 | 442 |
| n_identical_to_original | 14 | 13 | 12 |
## SD-1.5 vs SDXL (same 455 val images, same cleaning rules)
| method | psnr_mean | psnr_median | ssim_mean | lpips_mean | psnr_masked_mean | mae_masked_mean | n_with_damage | n_identical_to_original |
|:-----------------|------------:|--------------:|------------:|-------------:|-------------------:|------------------:|----------------:|--------------------------:|
| baseline_damaged | 25.7173 | 24.9115 | 0.9553 | 0.062 | 8.8905 | 78.9851 | 441 | 14 |
| sd15_gt_mask | 29.5035 | 28.5969 | 0.9567 | 0.0233 | 15.198 | 32.95 | 441 | 13 |
| sd15_yolo_mask | 29.5426 | 28.6877 | 0.9568 | 0.0253 | 14.8138 | 34.2863 | 441 | 12 |
| sdxl_gt_mask | 29.2984 | 28.5442 | 0.9568 | 0.0268 | 14.9486 | 34.5409 | 442 | 13 |
| sdxl_yolo_mask | 29.38 | 28.608 | 0.9574 | 0.028 | 14.7722 | 35.8809 | 442 | 12 |
### Paired differences (SDXL minus SD-1.5)
| mask_source | metric | better_is | mean_diff_sdxl_minus_sd15 | ci95_low | ci95_high | sdxl_win_rate | n |
|:--------------|:------------|:------------|----------------------------:|-----------:|------------:|----------------:|----:|
| yolo_mask | lpips | lower | 0.0026 | 0.0015 | 0.0036 | 0.23 | 455 |
| yolo_mask | ssim | higher | 0.0006 | -0.0002 | 0.0016 | 0.56 | 455 |
| yolo_mask | psnr_masked | higher | -0.2532 | -0.4491 | -0.0683 | 0.448 | 441 |
| yolo_mask | mae_masked | lower | 1.676 | 1.0973 | 2.3122 | 0.389 | 441 |
| gt_mask | lpips | lower | 0.0035 | 0.0028 | 0.0043 | 0.247 | 455 |
| gt_mask | ssim | higher | 0.0001 | -0.0003 | 0.0006 | 0.557 | 455 |
| gt_mask | psnr_masked | higher | -0.2646 | -0.4697 | -0.0639 | 0.454 | 441 |
| gt_mask | mae_masked | lower | 1.6292 | 0.9989 | 2.2163 | 0.399 | 441 |
### FID / KID vs original paintings
| method | fid | kid_mean | kid_std |
|:-----------------|--------:|-----------:|----------:|
| baseline_damaged | 24.0088 | -0.0007 | 0.0024 |
| sd15_yolo_mask | 8.2129 | -0.0013 | 0.0029 |
| sd15_gt_mask | 7.5614 | -0.0016 | 0.0027 |
| baseline_damaged | 24.0088 | -0.0007 | 0.0024 |
| sdxl_yolo_mask | 8.9906 | -0.0012 | 0.0028 |
| sdxl_gt_mask | 8.7454 | -0.0015 | 0.0027 |
Training config: `{"LORA_RANK": 16, "LR": 0.0001, "BS": 2, "ACCUM": 4, "MAX_STEPS": 2000, "P_GT_MASK": 0.3, "MASK_W": 2.0, "RES": 768}`
|