Skip to content

Custom Art

SORA edited this page Nov 27, 2026 · 2 revisions

Swap the operator splash for your own art with art=. Works on both operator templates.

image = await cards.render(build, art=Path("my_art.png"))
image = await cards.render(build, art=attachment_bytes, template=2)
image = await cards.render(build, art=pillow_image)
image = await cards.render(build, art="https://example.com/art.png", allow_remote=True)

art by pigeonfight99

art by kisaragi_pana

In a bot

Text urls and text paths are off by default. That's on purpose: if a user can type a path and you pass it straight in, they could make your bot open files on your machine.

  • uploads: pass the bytes, that's always fine
  • links from users: allow_remote=True is ok, private and local addresses stay blocked, downloads stop at 15 MB and after 3 redirects
  • never turn on allow_local for anything a user typed

When a url fails

Some hosts block scripts. Download it yourself (or take it as an upload) and pass the bytes.

Custom art cards aren't cached, the art behind a url can change.

akef-cards


📖 Docs site
📦 PyPI
💻 Repo

Clone this wiki locally