Generate and edit AI images from Clojure with no API key and no account.
(require '[kavel.core :as kavel]) (kavel/generate "a paper boat at sunrise, soft fog, 35mm film") ;; => {:url "https://cdn.kavel.ai/uploads/kie/image/....webp" :watermarked? true}
Without a key it calls the anonymous tier of https://www.kavel.ai, so the first call works on a machine with nothing configured. With :api-key (or the KAVEL_API_KEY environment variable) every call runs on your account.
Failures throw ex-info whose data carries :reason, one of :quota, :rejected, :sign-in, :auth, :timeout or :other, so a caller can tell waiting from rewording from signing in.
Generate and edit AI images from Clojure with no API key and no account.
(require '[kavel.core :as kavel])
(kavel/generate "a paper boat at sunrise, soft fog, 35mm film")
;; => {:url "https://cdn.kavel.ai/uploads/kie/image/....webp" :watermarked? true}
Without a key it calls the anonymous tier of https://www.kavel.ai, so the
first call works on a machine with nothing configured. With :api-key (or the
KAVEL_API_KEY environment variable) every call runs on your account.
Failures throw ex-info whose data carries :reason, one of :quota, :rejected,
:sign-in, :auth, :timeout or :other, so a caller can tell waiting from
rewording from signing in.(credits)What a fresh anonymous client id is granted, as {:remaining :grant}. Free to call.
What a fresh anonymous client id is granted, as {:remaining :grant}. Free to call.
(edit source-url instruction)(edit source-url instruction opts)Rewrites the image at source-url following instruction and returns {:url :watermarked?}. Say what must stay as well as what changes.
An edit costs more than the free allowance, so without an :api-key this throws with :reason :quota before anything is charged.
Rewrites the image at source-url following instruction and returns
{:url :watermarked?}. Say what must stay as well as what changes.
An edit costs more than the free allowance, so without an :api-key this
throws with :reason :quota before anything is charged.(generate prompt)(generate prompt opts)Turns prompt into a new image and returns {:url :watermarked?}.
opts: :aspect-ratio ("1:1" "16:9" "9:16" "4:3" "3:4", default "1:1"), :api-key, :model (honoured only with a key), :timeout-ms, :poll-ms, :http-client (a java.net.http.HttpClient, for a proxy).
Name the light, the material and the composition. "matte black ceramic mug on pale oak, soft window light from the left" gives the model a picture, "a product photo of a mug" does not.
Turns prompt into a new image and returns {:url :watermarked?}.
opts: :aspect-ratio ("1:1" "16:9" "9:16" "4:3" "3:4", default "1:1"),
:api-key, :model (honoured only with a key), :timeout-ms, :poll-ms,
:http-client (a java.net.http.HttpClient, for a proxy).
Name the light, the material and the composition. "matte black ceramic mug
on pale oak, soft window light from the left" gives the model a picture,
"a product photo of a mug" does not.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |