Skip to content
Agentmart
Submit a tool

stable-diffusion-image-generation

Generate images using Stable Diffusion via HuggingFace Diffusers library locally or via API

Skill by taracodlabs

IndexedApache-2.0★ 863
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/taracodlabs-stable-diffusion-image-generation-97956a

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Generate images using Stable Diffusion via HuggingFace Diffusers library locally or via API

Use cases: backend, ml

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/stable-diffusion-image-generation

What's inside

Skill name
stable-diffusion-image-generation
Description
Generate images using Stable Diffusion via HuggingFace Diffusers library locally or via API
License
Apache-2.0
Instructions
128 lines in SKILL.md · view on GitHub

Before installing

  • Instructions call the network

Files (2)

  • SKILL.md
  • skill.json

SKILL.md (first lines)

# Stable Diffusion Image Generation

Generate images from text prompts using Stable Diffusion locally via HuggingFace Diffusers, or via the HuggingFace Inference API for zero-install operation.

## When to Use

- User wants to generate an image from a text description
- User wants to create concept art, illustrations, or visual mockups
- User wants to experiment with AI image generation locally
- User wants to generate multiple variations of an image
- User wants to use img2img (image-to-image) transformation

## How to Use

### 1. Quick generation via HuggingFace Inference API (no GPU needed)

```python
import requests, base64, os

def generate_image_api(prompt, output="output.png"):
  api_url = "https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-xl-base-1.0"
  headers = {"Authorization": f"Bearer {os.environ['HF_TOKEN']}"}
  resp    = requests.post(api_url, headers=headers, json={"inputs": prompt}, timeout=120)
  resp.raise_for_status()
  with open(output, "wb") as f:
    f.write(resp.content)
  print(f"Saved: {output}")

# Set HF_TOKEN in env: huggingface.co/settings/tokens
generate_image_api("a futuristic city at night, cyberpunk style, neon lights, 8k")
```

### 2. Local generation with Diffusers (requires GPU or CPU + patience)

```python
# pip install diffusers transformers accelerate torch
from diffusers import StableDiffusionXLPipeline
import torch

pipe = StableDiffusionXLPipeline.from_pretrained(
  "stabilityai/stable-diffusion-xl-base-1.0",
  torch_dtype=torch.float16,
  use_safetensors=True
)
pipe = pipe.to("cuda")   # use "cpu" if no GPU (very slow)

image = pipe(
  prompt="a majestic mountain landscape at golden hour, photorealistic",
  negative_prompt="blurry, low quality, cartoon",
  num_inference_steps=30,
  guidance_scale=7.5,
  width=1024, height=1024
).images[0]

image.save("landscape.png")
print("Saved: landscape.png")
```

### 3. Generate multiple variations

```python
images = pipe(
  prompt="a robot reading a book in a cozy library",
  num_images_per_prompt=4,
  num_inference_steps=25,
).images

for i, img in enumerate(images):
  img.save(f"variation_{i+1}.png")
  print(f"Saved variation_{i+1}.png")
```

### 4. Write effective prompts

Good prompt structure:
```
[subject], [style], [setting/background], [lighting], [quality tags]

Examples:
"a golden retriever puppy, oil painting style, in a sunlit meadow, warm afternoon light, highly detailed"
"abstract data visualization, dark background, glowing cyan lines, geometric patterns, 4k"
"portrait of a scientist, dramatic studio lighting, photorealistic, sharp focus, professional headshot"
```

Useful negative prompt additions:
```
"blurry, low quality, watermark, signature, deformed, extra limbs, bad anatomy, poorly drawn"
```

### 5. CPU-only generation (slower but works without GPU)

```python
from diffusers import StableDiffusionPipeline
import torch

pipe = StableDiffusionPipeline.from_pretrained(
  "runwayml/stable-diffusion-v1-5",
  torch_dtype=torch.float32
)

image = pipe(
  prompt="a simple landscape, watercolor style",
  num_inference_steps=15,    # fewer steps = faster on CPU
  width=512, height=512      # smaller size for CPU
).images[0]
image.save("output.png")
```

## Examples

**"Generate an image of a futuristic AI lab"**
→ Use step 1 (API) if `HF_TOKEN` is set. Prompt: `"futuristic AI research lab, holographic displays, clean aesthetic, cinematic lighting"`.

**"Create 4 variations of a logo concept for a tech startup"**
→ Use step 3 with a logo-style prompt and `num_images_per_prompt=4`.

**"Generate an image locally without internet"**
→ Use step 2 (local Diffusers). SDXL needs ~8GB VRAM; for CPU use step 5 with SD v1.5 at 512×512.

From taracodlabs/aiden, Apache-2.0.

More from taracodlabs/aiden

Compare and alternatives

    Featured in

    Signals

    Stars
    863
    Forks
    150
    Open issues
    12
    Last commit (this folder)
    May 3, 2026 (5 months ago)
    Last release
    Oct 19, 2026 (8 days ago)

    From GitHub (fetched Oct 24, 2026).

    Details

    License
    Apache-2.0
    First seen
    Oct 24, 2026
    Last checked
    Oct 24, 2026

    More from taracodlabs

    Cite this page

    stable-diffusion-image-generation skill. Agent Mart. https://agentmart.dev/skills/taracodlabs-stable-diffusion-image-generation-97956a (last updated 2026-10-24)