Skip to main content

strands-diffusers

strands-diffusers — one tool, 300+ diffusion pipelines, every modality

Awesome Strands Agents

The universal entrypoint to HuggingFace diffusers for Strands agents. One tool — use_diffusers — wraps the whole library with zero hardcoding: discover and run any of its 300+ pipelines across every modality. It's a visual library, so here's what it actually produces — every asset below is real model output, not a placeholder:

text → image

any of 108 image pipelines
text → video

LTX · Wan · CogVideoX · Hunyuan
robot actions 🤖

Cosmos WFM: world video + actions
text → audio

StableAudio · AudioLDM2
text / image / video / robot-state  IN
image / video / audio / actions / 3d  OUT

The registry is built at runtime from diffusers._import_structure, so new pipelines are supported automatically with no code change. Same philosophy as use_aws, use_lerobot, and use_transformers: discover, don't hardcode.

3D mesh

ShapE - verts/faces to .ply
audio (hear the .wav)

StableAudio - waveform to .wav

100% coverage, zero hardcoding

Every pipeline, model, and scheduler diffusers ships is reachable through one tool. When diffusers adds a new pipeline, use_diffusers exposes it immediately.

Physical-AI: world-foundation models with action outputs

Cosmos world rollout


"Put the pot to the left of the purple item."

"Pick up the cloth and place it in the bowl."

"Open the drawer and place the spoon inside."

Same robot, same first observation — different task prompt → different imagined world and different predicted actions. Five real rollouts + all three Cosmos action modes in the WFM gallery.

This is the headline. A Cosmos action-policy rollout predicts both a future world video and the robot action chunk that produces it. One use_diffusers(action="run", ...) returns a .mp4 world video, a .json action chunk (normalized [-1, 1], shape [num_chunks, T, action_dim]), and optional .wav sound — and you can see the motion:

time-series (every dim, gripper highlighted)
end-effector path (dims 0–2)

Verified end-to-end on NVIDIA Thor (nvidia/Cosmos3-Nano, bf16/cuda): one call produced a world video (17, 480, 640, 3) and an action chunk (1, 16, 10). See examples/cosmos_action_policy.py.

Install

pip install -e .
pip install -e ".[video,audio]"   # mp4 export, wav I/O

Quick start

from strands import Agent
from strands_diffusers import use_diffusers

agent = Agent(tools=[use_diffusers])
agent("Generate an image of a robot arm in a kitchen")
agent("Run a Cosmos action-policy rollout on robot.mp4 and give me the actions")

Direct:

use_diffusers(action="run", pipeline="StableDiffusionPipeline",
              model="stabilityai/stable-diffusion-2-1",
              parameters={"prompt": "a robot arm in a kitchen"})
# -> {"artifacts": ["/tmp/strands_diffusers/image_*.png"]}

Two layers

run loads a pipeline via from_pretrained and calls it; inputs are coerced (path / URL / base64 to PIL / video), outputs auto-saved and returned by path.

call resolves and calls any diffusers class, function, or method (schedulers, VAEs, CosmosActionCondition, utils). cached:key references resolve to live objects; "**" unpacks a cached mapping into kwargs.

use_diffusers(action="call", target="CosmosActionCondition",
              parameters={"mode": "policy", "video": "robot.mp4"}, cache_key="cond")
use_diffusers(action="run", pipeline="Cosmos3OmniPipeline", model="nvidia/Cosmos3-Nano",
              parameters={"prompt": "...", "action": "cached:cond"},
              dtype="bfloat16", device="cuda")

Discovery

action returns
pipelines / models / schedulers classes + derived modality
tasks / modalities / wfm task maps / modality groups / world-foundation models
pipeline_info / inspect signature + docs
visualize action chunk to plots + animation
cache / clear_cache manage loaded pipelines

Architecture

core/registry.py  zero-hardcode taxonomy from diffusers._import_structure
core/engine.py    load/cache pipelines, auto device+dtype
core/io.py        coerce inputs; serialize video/image/audio/action/mesh
core/viz.py       render robot action chunks to plots + animation
tools/use_diffusers.py  the single @tool: run + call + discovery

Testing

pip install -e ".[video,audio,dev]"
pytest tests/ -q          # unit tests, no GPU, no downloads
python examples/smoke.py  # E2E gate on tiny fixtures

Every visual in this README and the docs is produced by real use_diffusers calls — regenerate them with:

python examples/generate_docs_assets.py

Docs

📖 cagataycali.github.io/strands-diffusers — quickstart, full gallery (images / video / audio / actions / 3D), the world-foundation-model story, discovery, and the two-layer design.

MIT

MCP Server (Claude Code / Claude Desktop / Cursor / any MCP client)

No install needed — just uvx:

uvx strands-diffusers                    # stdio (Claude Code / Desktop)
uvx strands-diffusers --http --port 8020 # HTTP multi-client

Claude Code: claude mcp add diffusers -- uvx strands-diffusers

Claude Desktop:

{"mcpServers": {"diffusers": {"command": "uvx", "args": ["strands-diffusers"]}}}
Prefer pip?
pip install "strands-diffusers[mcp]"
strands-diffusers-mcp

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

strands_diffusers-0.3.3.tar.gz (13.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

strands_diffusers-0.3.3-py3-none-any.whl (35.0 kB view details)

Uploaded Python 3

File details

Details for the file strands_diffusers-0.3.3.tar.gz.

File metadata

  • Download URL: strands_diffusers-0.3.3.tar.gz
  • Upload date:
  • Size: 13.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.11

File hashes

Hashes for strands_diffusers-0.3.3.tar.gz
Algorithm Hash digest
SHA256 cf22a40d1744f0cd2c811b6b42642f6be98ff0e770db1a9a39e56eeaeb8aaa12
MD5 632f4f2053d086685adc00ee5606904f
BLAKE2b-256 68db0bd9d04dda0b70bb0a2635de782428c6232f21b8d52bf62946b0432c7131

See more details on using hashes here.

File details

Details for the file strands_diffusers-0.3.3-py3-none-any.whl.

File metadata

File hashes

Hashes for strands_diffusers-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1de6b8dfceb1c51179eee607ae39a9841c248d2230cae385d9b337ed6756447e
MD5 e62b8b05ea5c7282a458215eca49e855
BLAKE2b-256 dae1abdbbdb1e3aa39b21d122bd7f4859fcc13f658bb5c0cecc24a90e1e6867d

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.3.3 This release

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page