šØ Build a Free AI Image Editor Using Airforce & ImgBB (No Server, Just a Browser!)
Ever needed to quickly tweak an image with AI but didn't want to fire up heavy software or pay for a subscription? Iāve built a lightweight, zeroābackend web tool that lets you edit your own images using the Airforce AI API, host them temporarily on ImgBB, and keep a local history of your edits ā all from a single HTML file.
š GitHub Repo: Free-AI-Image-Editor
Star the repo ā to support the project and help others discover it!
š§ What It Does
- Upload an image from your device.
- Describe the change you want with a natural language prompt.
- Send the image to ImgBB (free temporary hosting).
- Process it through Airforceās image generation/editing models.
- Receive the edited image directly in your browser.
- All edits are saved in your browserās localStorage with thumbnails, prompts, and model info ā a full edit history!
The editor runs entirely clientāside, so your API keys and images never touch a backend server (except the official APIs). No database, no login, no cost beyond the free tiers of the APIs.
š§ Features at a Glance
- š¼ļø Multiple AI models ā Nanobanana 2, Image 1 Edit, Flux 2 Pro, and more.
- š Edit history ā Stores up to 25 edits locally, with thumbnails and metadata. Delete individual entries or clear all.
- š· Original/Edited preview ā Sideābyāside comparison.
- ā” Streaming results ā SSEābased realātime image generation updates.
- š”ļø Fully private ā Your API keys are only used clientāside; no thirdāparty tracking.
- š± Responsive ā Works on desktop and mobile.
š How to Use (2āMinute Setup)
1. Get Your Free API Keys
- Airforce API Key ā Dashboard
- ImgBB API Key ā api.imgbb.com (free registration, no credit card)
2. Open the Tool
Clone the repo and open Image Edit 2.html in your favourite browser ā yes, itās that simple.
Or just download the HTML file from the repo and doubleāclick it.
3. Start Editing
- Paste your API keys.
- Choose an AI model from the dropdown.
- Select an image and write a prompt (e.g., āmake the sky sunset orangeā).
- Click Edit Image and watch the magic happen.
All successful edits are automatically added to the history section below.
𧬠How It Works (Code Highlights)
The entire logic is vanilla JavaScript using fetch and the Streams API. Hereās the core flow:
// Step 1: Upload to ImgBB
const publicUrl = await uploadToImgBB(selectedFile, imgbbKey);
// Step 2: Send to Airforce with image_url
const response = await fetch("https://api.airforce/v1/images/generations", {
method: "POST",
headers: {
Authorization: `Bearer ${airforceKey}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: modelSelect.value,
prompt: prompt,
n: 1,
size: "1024x1024",
response_format: "url",
image_urls: [publicUrl],
}),
});
// Step 3: Stream the SSE response
const reader = response.body.getReader();
while (true) {
const { done, value } = await reader.read();
// ... process SSE lines, extract final image URL
}
History is stored with localStorage and resized thumbnails are generated using <canvas>. Itās a great example of how powerful modern browsers have become.
ā Why You Should Star the Repo
- Itās 100% free and openāsource ā no hidden fees, no ads.
- You can modify it for your own workflows (e.g., batch processing, different storage backends).
- It demonstrates realāworld use of SSE, canvas thumbnails, localStorage, and API orchestration ā perfect for learning or teaching.
- I actively maintain it and welcome contributions, bug reports, and feature requests.
If you find this tool handy, please star the repo on GitHub ā it takes a second and helps me know people are using it. Share it with your friends who might need a quick image editor!
š ļø Tech Stack
- HTML5 + CSS (dark theme, fully responsive)
- Vanilla JavaScript (no frameworks)
- Airforce API ā AI image generation/editing
- ImgBB API ā temporary image hosting
-
localStorageā edit history persistence
š¤ Credits
Built by Aryan Singh ā you can find more projects and join the discussion on Discord.
Try it now and never pay for AI image editing again. Happy tweaking! āØ
Top comments (0)