Create an infinite icon library by fine-tuning Stable Diffusion
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.
Related posts
- Making a web app generator with open ML models
Hugging Face mediumAdeptA Node.js/Express server can generate web apps from a text prompt by streaming tokens from a code LLM (WizardCoder-15B on Hugging Face Inference Endpoints) straight into the browser as HTML. Prompt tuning does most of the work: terse imperative instructions, pre-seeding the output with `<html><body class=...>`, and requiring TailwindCSS so styles arrive inline without a stylesheet that stalls rendering. Image URLs come from a Stable Diffusion `/image` endpoint that the model is told to call. Alpine.js provides a minimal UI, and DaisyUI's shorthand classes cut token usage compared with verbose Tailwind utility classes.
- 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.
- Generate Images Locally with Docker Model Runner and Open WebUI
Docker mediumAdeptDocker Model Runner can now serve diffusion image models locally through an OpenAI-compatible /v1/images/generations endpoint. Paired with Open WebUI, that gives you private, offline image generation from a chat interface. Models are distributed as DDUF single-file artifacts via Docker Hub, `docker model launch openwebui` wires up the UI, and an admin setting points image generation at the diffusers endpoint. The walkthrough also covers calling the API directly with curl, including negative prompts, inference steps, guidance scale and seeds. Under the hood, the backend unpacks the DDUF into a Diffusers pipeline served by a version-pinned FastAPI server.
- 2D Asset Generation: AI for Game Development #4
Hugging Face mediumAdeptStable 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.
- Run ComfyUI workflows for free with Gradio on Hugging Face Spaces
Hugging Face mediumAdeptA ComfyUI node workflow can be turned into a standalone Gradio app and hosted for free on Hugging Face Spaces' serverless ZeroGPU tier. The steps: export the workflow to Python with ComfyUI-to-Python-Extension, then rewrite its main() into a generate_image function whose hard-coded node values become UI inputs and which returns the saved image path. To prepare for Spaces, fetch the models with hf_hub_download instead of uploading them, wrap inference in the @spaces.GPU decorator, and merge the custom nodes' dependencies into one requirements.txt. Loading models in global scope, outside the decorated function, keeps ZeroGPU from reloading them from disk on every run.