Socket
Book a DemoInstallSign in
Socket

text2image-ai

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

text2image-ai

A simple Node.js wrapper for generating AI images from text prompts with multi-language support.

1.0.5
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

Text2Image AI ๐Ÿ–ผ๏ธ

โœ… Free to use! NO LIMIT! ๐Ÿ–Œ๏ธ Generate AI-powered images from text prompts! Supports Base64 output and multiple languages.

NPM Version
Downloads
License

๐Ÿ“ฆ Installation

npm install text2image-ai

๐Ÿš€ Features

โœ… AI-powered image generation from text
โœ… Supports multiple languages (en, tr, es, fr, de)
โœ… Returns Base64 encoded images
โœ… Lightweight and easy to use
โœ… Can be used in CLI or server-side applications

๐Ÿ”ฅ Quick Start

const { generateImage } = require("text2image-ai");

async function main() {
  const result = await generateImage("a futuristic city at sunset", "en");
  console.log(result);
}

main();

๐Ÿ“Œ Example Output:

{
  "originalPrompt": "a futuristic city at sunset",
  "translatedPrompt": "a futuristic city at sunset",
  "language": "en",
  "base64Image": "/9j/4AAQSkZ..."
}

๐Ÿ’พ Saving the Image (Base64 to File)

You can convert the Base64 image to a file using fs in Node.js.

const { generateImage } = require("text2image-ai");
const fs = require("fs");

async function saveImage() {
  const result = await generateImage("a cyberpunk city at night", "en");
  
  // Remove the data URI prefix and convert Base64 to binary
  const base64Data = result.base64Image;
  const buffer = Buffer.from(base64Data, "base64");

  // Save the image
  fs.writeFileSync("output.jpg", buffer);
  console.log("โœ… Image saved as output.jpg");
}

saveImage();

๐ŸŒ Language Support

Language CodeLanguage
enEnglish
trTurkish
esSpanish
frFrench
deGerman

If a different language is provided, it defaults to English.

๐Ÿ“œ License

This project is licensed under the MIT License.

๐ŸŒŸ Support & Contact

  • GitHub Issues: Report Bugs or Request Features
  • โญ Give a Star: If you like this package, support by starring the repo!

๐Ÿš€ Ready to create amazing AI-generated images? ๐Ÿ˜Ž

Keywords

text-to-image

FAQs

Package last updated on 26 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with โšก๏ธ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.