New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

text-se-image

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

text-se-image

Generate image using prompt.

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

🖼️ text-se-image

A simple Node.js package to generate AI image URLs. Just pass a prompt (and optionally choose a model), and get back a direct image URL.

✨ Features

  • 🚀 Lightweight — no dependencies
  • 🎨 Generate AI image URLs instantly
  • 🛠️ Defaults included (512×512, seed 42, flux model)
  • 📦 Easy to use in Node.js (supports both CommonJS and ESM)

📦 Installation

npm install text-se-image

🔧 Usage

CommonJS

const { generateImage } = require("text-se-image");

(async () => {
  const url = await generateImage("A futuristic city skyline at sunset");
  console.log(url);
})();

ES Modules

import { generateImage } from "text-se-image";

const url = await generateImage("A futuristic city skyline at sunset");
console.log(url);

⚙️ API

generateImage(prompt, model?)

Generates an image URL from a given prompt.

  • prompt (string, required) → The text description of the image.

  • model (object, optional) → Choose which model to use.

    • Default: { id: "flux" }

Example with custom model

const url = await generateImage("A cyberpunk robot", { id: "flux-schnell" });
console.log(url);

🎨 Example Output

Input:

await generateImage("A cute cat wearing glasses");

Output:

https://image.pollinations.ai/prompt/A%20cute%20cat%20wearing%20glasses?width=512&height=512&seed=42&model=flux&nologo=true

🖼️ Available Models

You can pass any of these models in the second parameter:

Model IDDescription
fluxHigh-quality image generation (default)
flux-schnellFaster, lightweight version of Flux
turboUltra-fast but lower quality images
majesticStylized, artistic outputs
animeOptimized for anime/manga style images
realisticMore photorealistic images

✅ Example:

const url = await generateImage("An anime-style dragon", { id: "anime" });
console.log(url);

📝 Notes

  • The package returns only the image URL (not the image itself).
  • You can use the URL directly in <img> tags or fetch it in your app.
  • Defaults: width = 512, height = 512, seed = 42, model = flux.

👨‍💻 About the Author

Rishav Tiwari — Software Developer with a passion for AI, automation, and building developer tools. When I’m not coding, I love exploring new ideas, experimenting with AI projects, and helping others learn tech.

  • 🌐 GitHub: https://github.com/rishavtiwari22

📄 License

MIT © 2025 Rishav Tiwari

Keywords

npm

FAQs

Package last updated on 27 Aug 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