Transform reality into encoded art. Generate images with AI and convert them to ASCII masterpieces.
https://aelune.onrender.com
You can use the API from any environment that supports HTTP requests:
curl -X POST https://aelune.onrender.com/api/generate-image \
-H "Content-Type: application/json" \
-d '{"prompt": "a cyberpunk city at night", "variations": 1}'This repository includes example JavaScript modules for easy integration:
# Navigate to the api directory
cd api
# Use the provided examples
node full-example.jsAvailable modules:
generate-image.js- Image generation helpercheck-status.js- Status polling and completion waitingascii-encoder.js- Client-side ASCII encodingfull-example.js- Complete workflow example
Generate AI images from text prompts using Google's Imagen-4 model.
Endpoint: POST /api/generate-image
Request Body:
{
"prompt": "your image description here",
"variations": 1
}Parameters:
prompt(string, required): Text description of the image to generatevariations(number, optional): Number of image variations to create. Default: 1
Response:
{
"success": true,
"jobId": "unique-job-identifier",
"estimatedTime": "30-60 seconds"
}Example:
const response = await fetch('https://aelune.onrender.com/api/generate-image', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
prompt: 'a cyberpunk city at night with neon lights',
variations: 1
})
});
const data = await response.json();
console.log(data.jobId); // Use this to check statusPoll the status of your image generation job.
Endpoint: GET /api/image-status/:jobId
Parameters:
jobId(string, required): The job ID returned from generate-image endpoint
Response (Processing):
{
"status": "processing"
}Response (Success):
{
"status": "succeeded",
"images": [
"https://replicate.delivery/pbxt/image-url.png"
]
}Response (Failed):
{
"status": "failed"
}Example:
const checkStatus = async (jobId) => {
const response = await fetch(`https://aelune.onrender.com/api/image-status/${jobId}`);
const data = await response.json();
if (data.status === 'succeeded') {
console.log('Image ready:', data.images[0]);
} else if (data.status === 'processing') {
console.log('Still generating...');
setTimeout(() => checkStatus(jobId), 2000); // Check again in 2s
}
};Retrieve generated media files by ID.
Endpoint: GET /api/media/:fileId
Parameters:
fileId(string, required): The media file identifier
Response: Returns the media file with appropriate content-type headers.
- Aspect Ratio: 16:9 (widescreen)
- Model: Advanced AI Image Generation
- Output Format: PNG
- Generation Time: Approximately 30-60 seconds
- Clone the repository:
git clone https://github.com/Aelune/Aelune-API.git
cd Aelune-API- Install dependencies:
npm install- Configure environment variables:
Create a
.envfile in the root directory:
BACKEND_URL=https://aelune.onrender.com
# Add your API tokens here if self-hosting- Run the development server:
npm run devThe application will be available at http://localhost:3000
Example: Generate and retrieve an image
// Import the modules
const { generateImage } = require('./api/generate-image.js');
const { waitForCompletion } = require('./api/check-status.js');
async function main() {
// Generate image
const job = await generateImage('a peaceful zen garden');
console.log('Job started:', job.jobId);
// Wait for completion
const result = await waitForCompletion(job.jobId);
console.log('Image URL:', result.images[0]);
}
main();Example: Full workflow with ASCII encoding
const { generateAndEncode } = require('./api/full-example.js');
// Generate image and get URL for encoding
generateAndEncode('cyberpunk city at night')
.then(result => {
console.log('Ready for ASCII encoding!');
console.log('Image URL:', result.imageUrl);
});Test image generation:
curl -X POST https://aelune.onrender.com/api/generate-image \
-H "Content-Type: application/json" \
-d '{
"prompt": "test image generation",
"variations": 1
}'Test status checking:
curl https://aelune.onrender.com/api/image-status/YOUR_JOB_IDThe Aelune encoder transforms images into monochrome ASCII art using character density mapping.
Font Size:
- Image mode: 5-20px (default: 8px)
- Video mode: 10-20px (default: 11px)
Character Spacing:
- Range: -10 to 0px (default: -5px)
- Negative values create denser output
Output Resolution:
- Images: 700px height, aspect-ratio preserved
- Videos: 1080px height (Full HD)
The encoder uses 7 characters representing brightness levels:
' ' → Space (darkest, 0-51 brightness)
"'" → Apostrophe (51-102)
':' → Colon (102-140)
'i' → Lowercase i (140-170)
'I' → Uppercase I (170-200)
'J' → Uppercase J (200-210)
'$' → Dollar sign (brightest, 210-255)
- Recording FPS: 120 (ultra-smooth playback)
- Output Format: WebM
- Bitrate: 25 Mbps (maximum quality)
- Codec: VP9 (fallback to VP8/WebM)
The API uses a token-based queue system to manage rate limits across multiple Replicate API keys. Requests are automatically queued and processed as tokens become available.
- Website: aelune.xyz
- X/Twitter: @AeluneTech
- GitHub: Aelune/Aelune-API
All endpoints return appropriate HTTP status codes:
200- Success400- Bad Request (missing or invalid parameters)404- Not Found (invalid jobId or fileId)500- Internal Server Error
Error Response Format:
{
"success": false,
"message": "Error description here"
}The grid is eternal. The truth is monochrome. The transformation starts now.