2D Asset Generation: AI for Game Development #4
Stable Diffusion's Image2Image mode can be used as one step in a conventional 2D art workflow rather than a replacement for it: rough hand sketches are fed in, the output is painted over in an image editor, and the result is fed back in. Denoising strength sets how far the output strays from the input. A corn icon was produced in under 10 minutes by starting at 0.8 for exploration and dropping to 0.6 for refinement. A scythe icon was harder because training data skews toward weapons. That kind of bias can be countered with prompt engineering and negative prompts, or with customization techniques such as DreamBooth, textual inversion and LoRA.
Related posts
- Open Preference Dataset for Text-to-Image Generation by the 🤗 Community
Hugging Face easyNoviceData is Better Together released an Apache 2.0 text-to-image preference dataset of 10K pairs, with over 30K annotations from more than 250 community members collected in under two weeks. Imgsys prompts were deduplicated, filtered for NSFW content with text and image classifiers plus manual review, and rewritten with distilabel across style categories and simple versus complex variants. Images came from FLUX.1-dev and Stable Diffusion 3.5 Large. Annotators found FLUX better for anime, manga and 3D, and SD3.5 better for cinematic and art styles. A LoRA fine-tune of FLUX-dev on the chosen samples improved its weaker art and cinematic outputs.
- Create an infinite icon library by fine-tuning Stable Diffusion
Modal mediumAdept
Stable Diffusion v1.5 is fully fine-tuned on the ~300-icon Heroicons set to generate new icons in a similar black-and-white line style. Captions are derived from icon names like "golden-retriever" or "barack-obama". The walkthrough covers choosing between full, sequential-adapter and parallel-adapter (LoRA) fine-tuning, then preparing the data: rasterizing SVGs to PNG, adding white backgrounds, and building a metadata.csv of captions. Training uses the Diffusers train_text_to_image script on an A100 via Modal, with 4000 steps, learning rate 1e-5, batch size 1 and 128px resolution. Weights are saved to a Modal Volume and served on a cheaper A10G behind a Gradio UI, and dataset preparation proved the hardest and most important part.
- Instruction-tuning Stable Diffusion with InstructPix2Pix
Hugging Face hardMasterFine-tuning InstructPix2Pix on FLAN-style instruction-prompted datasets teaches Stable Diffusion to follow specific image transformation instructions such as cartoonization and low-level image processing (deraining, denoising, deblurring, low-light enhancement). The cartoonization dataset pairs 5,000 Imagenette images with Whitebox CartoonGAN outputs and 50 ChatGPT-generated instruction paraphrases, and the low-level dataset mixes samples from REDS, Rain13k, SIDD and LOL into a single multi-task set. Starting from an InstructPix2Pix checkpoint adapted faster than starting from base Stable Diffusion. Cartoonization and deraining results clearly beat the pre-trained model, while low-light enhancement and deblurring stayed weak, likely because those tasks had very few training samples. The results are preliminary, and open questions on dataset scale, task mixture and ControlNet alternatives remain.
- Stable Diffusion with 🧨 Diffusers
Hugging Face mediumAdeptStable Diffusion is a latent diffusion model that denoises compressed 64×64 latents rather than pixels, combining a VAE, a text-conditioned U-Net with cross-attention, and a frozen CLIP text encoder. The Diffusers walkthrough covers running it in a few lines with StableDiffusionPipeline, including fp16 loading for GPUs under 10GB, seeded generators for determinism, and tuning num_inference_steps (50 recommended) and guidance_scale (7–8.5). It explains why the 8× VAE compression (3×512×512 to 4×64×64) makes generation feasible on 16GB GPUs. It then shows how to build a custom inference pipeline by loading components individually and swapping in schedulers such as K-LMS.
- How we used evals and inference-time compute scaling to generate beautiful QR codes that actually work
Modal mediumAdept
Generating aesthetic QR codes (QArt codes) with Stable Diffusion and ControlNet often produces images that don't scan, so the team built automated evals: the QReader library for scannability and a community aesthetic predictor. They validated both against roughly two thousand hand-scanned and hand-rated prompt-URL pairs. They then swept ControlNet guidance timing and strength on Modal, using a "toast plot" grid to choose a configuration with better aesthetics but a lower scan rate. To recover reliability, they moved the evals into production: they generate many candidates in parallel on GPUs and rank them by scan success and then aesthetic score. That reached a 95% scan-rate SLO with p95 latency under 20 seconds.