Custom sticker and emoji packs are everywhere – messaging apps, product branding, community Discord servers. Designing them by hand takes hours per asset. Stable Diffusion can generate an entire pack in minutes, and with the right prompt structure and post-processing pipeline, the results are production-ready. Here’s how to set up the full workflow from generation to transparent PNGs sized for every major platform.
Start by installing the core dependencies:
| |
Generating Sticker-Style Images
The key to good sticker output is prompt engineering. Stickers need bold outlines, simple shapes, flat colors, and a clean background you can remove later. SDXL handles this well when you tell it exactly what visual style you want.
| |
A few things to note about the prompt structure. The phrase “die-cut sticker” pushes the model toward that characteristic sticker look with a visible border. Requesting “solid white background” makes background removal trivial in the next step. The negative prompt keeps the output flat and clean – you don’t want photorealism or complex lighting in a sticker.
Tuning the Style
Play with these prompt modifiers to shift the aesthetic:
- Kawaii style: Add “kawaii, cute, japanese sticker style”
- Cartoon bold: Add “thick outline, saturday morning cartoon”
- Minimal/geometric: Add “geometric, minimalist, flat design”
- Retro: Add “90s sticker, glossy, retro illustration”
Guidance scale matters here. Values between 7 and 9 keep the output faithful to sticker aesthetics. Go below 6 and you lose the clean lines. Go above 12 and you get over-saturated, artifact-heavy results.
Removing Backgrounds for Transparent PNGs
A sticker with a white background isn’t a sticker – it needs transparency. The rembg library uses the U2-Net model to strip backgrounds cleanly, and it handles the bold-outline sticker style particularly well since the subject-background boundary is sharp.
| |
The alpha_matting parameters fine-tune edge quality. The foreground threshold at 240 keeps nearly-white edge pixels from bleeding into the transparent area. The erode size trims a thin border of leftover background pixels. For stickers with bold outlines, these defaults work well. If you’re generating softer styles without outlines, drop alpha_matting_erode_size to 5 or lower.
Building a Sticker Pack Generator
A single sticker is nice. A matching pack of 10-20 is what you actually need. The trick is keeping the style prefix identical across all subjects so the pack looks cohesive.
| |
Using a fixed seed with torch.Generator helps with reproducibility, though style consistency comes mostly from the shared prefix. If one sticker in the batch looks off, regenerate just that one with a different seed while keeping the same prefix.
Emoji vs. Sticker Differences
Emoji need to read at tiny sizes. For emoji generation, adjust the prompt:
- Replace “sticker design” with “emoji icon”
- Add “extremely simple, minimal detail, bold expression”
- Drop “die-cut sticker” since emoji don’t have that outline style
- Use fewer colors: add “limited color palette, 3-4 colors max”
Resizing and Formatting for Platforms
Each platform has different requirements for sticker and emoji assets. Here’s a utility that takes your generated stickers and outputs correctly sized versions for the three major platforms.
| |
This centers the sticker on a transparent canvas at the target resolution. The thumbnail method preserves aspect ratio so nothing gets distorted. For iMessage, Apple also accepts APNG for animated stickers – that’s a different pipeline but the sizing logic is the same.
Platform-Specific Notes
- iMessage: Sticker packs need exactly 300x300 for small, 408x408 for medium, or 618x618 for large. Apple requires Xcode to package them into a
.stickerpacksbundle. - Telegram: 512x512 is the standard. One side must be exactly 512px, the other can be smaller. Animated stickers use TGS format (Lottie-based).
- Discord: Custom emoji max out at 128x128 and 256KB. Stickers are 320x320 with a 500KB limit.
Common Errors and Fixes
CUDA out of memory when generating at 1024x1024:
| |
SDXL needs around 8GB VRAM at fp16. If you’re on a smaller GPU, enable attention slicing and VAE tiling:
| |
Or drop to 768x768 generation and upscale afterward. The sticker style is forgiving at lower resolutions since it’s already simple shapes.
rembg produces jagged edges on soft-style stickers:
| |
This happens when the foreground-background contrast is too low. Make sure your generation prompt includes “solid white background” and increase the contrast between subject and background. You can also try the isnet-general-use model instead of the default:
| |
Inconsistent style across a sticker pack:
If stickers in a batch look like they belong to different packs, the issue is usually prompt drift. Lock down every style descriptor in the shared prefix and only vary the subject. Avoid adding style words in the subject portion (e.g., don’t write “a watercolor cat” when your prefix says “flat colors”). Also consider using a fixed seed across the batch or a LoRA trained on a specific sticker style for maximum consistency.
Related Guides
- How to Edit Images with AI Inpainting Using Stable Diffusion
- How to Generate Images with Stable Diffusion in Python
- How to Build AI Clothing Try-On with Virtual Diffusion Models
- How to Build AI Motion Graphics Generation with Deforum Stable Diffusion
- How to Build AI Scene Generation with Layered Diffusion
- How to Build AI Wallpaper Generation with Stable Diffusion and Tiling
- How to Fine-Tune Stable Diffusion with LoRA and DreamBooth
- How to Build AI Seamless Pattern Generation with Stable Diffusion
- How to Build AI Architectural Rendering with ControlNet and Stable Diffusion
- How to Build AI Sketch-to-Image Generation with ControlNet Scribble