Downloads · 30 days
8
7% of all-time downloads
Ricardouchub/SarcasmDiffusion
SarcasmDiffusion is a text-to-image model from Ricardouchub. Use it when you need an image from a text prompt. It is set up for diffusers. The card lists the license as mit.
Model type: Stable Diffusion XL (Base 1.0) fine‑tuned via LoRA (merged/fused) to learn the visual style of sarcastic/ironic memes. Author: Ricardo Urdaneta (github.com/Ricardouchub)
Downloads · 30 days
8
7% of all-time downloads
All-time downloads
117
Public
Parameters
2.6B
6.9 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors6.9 GB · 100%
From the Hugging Face model README
Model type: Stable Diffusion XL (Base 1.0) fine‑tuned via LoRA (merged/fused) to learn the visual style of sarcastic/ironic memes.
Author: Ricardo Urdaneta (github.com/Ricardouchub)
SarcasmDiffusion is a diffusion-based generative model focused on producing clean meme-style photographs that are suitable for caption overlays (text is added after generation). The model was LoRA‑fine‑tuned on a filtered and enriched subset of the Hateful Memes dataset to capture stylistic cues of humorous/ironic memes while avoiding offensive content.
stabilityai/stable-diffusion-xl-base-1.0This model focuses on style transfer for meme aesthetics (composition, lighting, “stock-photo vibe”), not on rendering text inside images. Add titles/subtitles with your own overlay function or editor.
r=8, alpha=16, dropout=0.05humor / irony / neutral.The dataset is not included here. Please obtain Hateful Memes under its original terms and reproduce the preprocessing if needed.
Known risks: dataset biases may remain; aesthetic biases (stock-photo look); occasional failure to respect negative prompts.
from diffusers import AutoPipelineForText2Image
import torch
pipe = AutoPipelineForText2Image.from_pretrained(
"Ricardouchub/SarcasmDiffusion",
torch_dtype=torch.float16
).to("cuda") # use "cpu" if no GPU
prompt = (
"sarcastic meme about checking the fridge for the third time, "
"centered subject, plain background, high-contrast photo, stock photo style"
)
negative = "nsfw, hate speech, slur, watermark, logo, low quality, blurry, busy background, text overlay"
g = torch.Generator(device=pipe.device).manual_seed(123)
image = pipe(prompt,
negative_prompt=negative,
num_inference_steps=22,
guidance_scale=6.3,
width=896, height=896,
generator=g).images[0]
image.save("sample.png")
steps=18–28, guidance=5.5–7.5, size=768–1024.To ensure full compatibility when loading this model (fused SDXL with LoRA merged), use the following library versions:
| Library | Recommended Version | Notes |
|---|---|---|
| Python | 3.10 – 3.12 | Tested on Colab (Python 3.12) |
| PyTorch | 2.6.0 + CUDA 12.4 | Any CUDA ≥ 12 works |
| diffusers | 0.35.1 | Core inference & model loading |
| transformers | 4.45.2 | Required for SDXL CLIPTextEncoder compatibility |
| accelerate | 1.10.1 | Device and fp16 inference management |
| huggingface_hub | 0.23.5 | Compatible with diffusers 0.35.x |
| safetensors | ≥ 0.4.5 | For secure model weights loading |
Install in Colab or local environment:
pip install "diffusers==0.35.1" "transformers==4.45.2" "accelerate==1.10.1" "huggingface_hub==0.23.5" safetensors
Important:
Using newer versions (e.g.,transformers ≥ 4.56) may break compatibility due to API changes inCLIPTextModel(offload_state_dictargument).
Always match the versions above for smooth loading.
By using this model, you agree not to generate content that is illegal, harmful, or violates rights of others.
Qualitative assessment via fixed prompt sheets (humor/irony/neutral). Suggested automatic metrics for future work: CLIP‑score vs. caption, aesthetic predictors, and human preference studies.