kavel 0.1.0
kavel: ^0.1.0 copied to clipboard
Generate and edit images from Dart and Flutter with no API key and no account, via the free tier of kavel.ai.
kavel #
Generate and edit images from Dart and Flutter with no API key, no account and no card.
dart pub add kavel # or: flutter pub add kavel
import 'package:kavel/kavel.dart';
final kavel = Kavel();
final img = await kavel.generate(
'matte black ceramic mug on pale oak, soft window light from the left, shallow depth of field',
aspectRatio: '16:9',
);
print(img.url); // https://cdn.kavel.ai/uploads/kie/image/....webp
final edited = await kavel.edit(img.url, 'place the mug on a white marble surface');
Every other image package wants a key from OpenAI, fal or Replicate before it runs once — and a key shipped inside a Flutter app is a key anyone can pull out of the binary. This one talks to the free tier of Kavel: a client id the package invents rather than an account you register, so there is no secret to ship.
Why it is shaped this way #
- One dependency,
http. Works in Flutter on every platform and in plain Dart CLIs. - An edit lane.
edittakes a photo you already have and one sentence describing the change. - A typed exception.
KavelException.kindis an enum —quotameans wait or sign in,rejectedmeans reword,signInmeans the request is off the free shelf. - It keeps polling through a dropped connection — a phone switching from Wi-Fi to cellular mid-job does not throw away a generation that is about to run.
Limits, measured against the running service #
- The free grant is 15 credits. An image costs 5, an edit costs 15. The package mints a new client id per call, so a loop is not capped at three.
- 30 credits per IP per day sits on top — about six images from one machine — and surfaces as
a
quotaexception. - Free output is 1K and watermarked;
img.watermarkedtells you instead of leaving you to guess. - Free runs queue 25–80 seconds before the model is called, which is why the default deadline is six minutes.
- Video does not run anonymously — the cheapest clip costs more than the grant. The AI video generator has a browser lane for that.
Signing in removes the watermark and opens the full shelf: Nano Banana 2 for up to 14 reference photos, GPT Image 2 for 4K output, Qwen Image 3 when the picture has to contain correctly spelled text, and Seedream 5.0 Pro for photoreal people. Pricing has every tier.
Prompts that work #
Name the light, the material and the composition — that moves the result more than adjectives do. For edits, say what changes and the model keeps the rest; it is the same Nano Banana 2 Lite lane behind the AI hairstyle changer and the AI outfit generator. The free AI image generator runs the same engines in a browser, and the showcase has finished output.
Tests #
dart test
Offline, with MockClient: argument validation, client id uniqueness, the quota wall (an HTTP 200
recognised only by a field), the sign-in refusal, and polling through a dropped connection.
More languages and recipes: kavel.readthedocs.io.
MIT