Downloads · 30 days
3
6% of all-time downloads
aryan-singh-2002/flickr30k-stable-diffusion-fine-tuned
flickr30k-stable-diffusion-fine-tuned is a machine learning model from aryan-singh-2002. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for diffusers.
Model type: Text-to-Image diffusion (Stable Diffusion v1.4 UNet fine-tune) Base model: CompVis/stable-diffusion-v1-4 Dataset: lmms-lab/flickr30k Framework: PyTorch (diffusers) Resolution: 512×512 Trained epochs: 3 Bat…
Downloads · 30 days
3
6% of all-time downloads
All-time downloads
48
Public
Parameters
860M
3.4 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors3.4 GB · 100%
From the Hugging Face model README
Model type: Text-to-Image diffusion (Stable Diffusion v1.4 UNet fine-tune)
Base model: CompVis/stable-diffusion-v1-4
Dataset: lmms-lab/flickr30k
Framework: PyTorch (diffusers)
Resolution: 512×512
Trained epochs: 3
Batch size: 1
Learning rate: 2e-5
Seed: 42
Optimizer: torch.optim.AdamW
Last updated: 2025-08-16
⚠️ What is in this repo?
This repository publishes a fine-tuned UNet for Stable Diffusion v1-4 rather than a full pipeline.
To generate images, load the base pipeline (CompVis/stable-diffusion-v1-4) and replace the UNet with the weights from this repo.
import torch
from diffusers import StableDiffusionPipeline, UNet2DConditionModel
repo_id = "YOUR_USERNAME/YOUR_REPO_NAME" # <— replace with your HF repo id
# 1) Load the base pipeline
pipe = StableDiffusionPipeline.from_pretrained(
"CompVis/stable-diffusion-v1-4", torch_dtype=torch.float16
).to("cuda")
# 2) Load the fine-tuned UNet from this repo and swap it in
ft_unet = UNet2DConditionModel.from_pretrained(repo_id)
pipe.unet = ft_unet
# 3) Inference
prompt = "a high-resolution photo of a golden retriever surfing a wave, cinematic lighting"
image = pipe(prompt, num_inference_steps=30, guidance_scale=7.5).images[0]
image.save("sample.png")
If you downloaded the UNet folder locally:
ft_unet = UNet2DConditionModel.from_pretrained("./ultra_fine_tuned_unet")
pipe.unet = ft_unet
CompVis/stable-diffusion-v1-4 (CreativeML Open RAIL-M)lmms-lab/flickr30k32e-51512torch.optim.AdamW42Note: The notebook saved only the UNet via
.save_pretrained("./ultra_fine_tuned_unet"). If you also want to publish the VAE and text encoder, re-save those components or export a full pipeline.
Safety recommendations
safety_checker=None is discouraged in production).pytorch_model.bin — UNet weights (uploaded by you)config.json — UNet architecture config (from UNet2DConditionModel)scheduler_config.json — (optional) if you choose to publish a recommended scheduler configREADME.md — This model cardLICENSE — License (see below)If you trained locally and only have
./ultra_fine_tuned_unet/, upload its contents directly to this repo root.
from diffusers import StableDiffusionPipeline, UNet2DConditionModel, DDPMScheduler, AutoencoderKL
import torch
base = "CompVis/stable-diffusion-v1-4"
pipe = StableDiffusionPipeline.from_pretrained(base, torch_dtype=torch.float16)
unet = pipe.unet # start from base UNet
# ... set up dataset, optimizer (AdamW), LR (2e-5), epochs (3), etc.
# train loop updating UNet weights only
unet.save_pretrained("./ultra_fine_tuned_unet") # published in this repo
CompVis/stable-diffusion-v1-4 — CreativeML Open RAIL-M.See LICENSE for details.
pip install -U "huggingface_hub[cli]" diffusers transformers accelerate torch
huggingface-cli login # paste your HF token
from huggingface_hub import HfApi, HfFolder, create_repo, upload_folder
repo_id = "YOUR_USERNAME/YOUR_REPO_NAME"
create_repo(repo_id, repo_type="model", private=False, exist_ok=True)
# Upload the UNet folder (generated by save_pretrained)
upload_folder(
repo_id=repo_id,
folder_path="./ultra_fine_tuned_unet",
path_in_repo=".",
repo_type="model"
)
# Also upload this README and LICENSE if running locally:
# api = HfApi()
# api.upload_file(repo_id=repo_id, path_or_fileobj="README.md", path_in_repo="README.md")
# api.upload_file(repo_id=repo_id, path_or_fileobj="LICENSE", path_in_repo="LICENSE")