
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
pollinations
Advanced tools
A Node.js package that allows you to easily access all Pollinations features, including image generation and LLM capabilities, using their free API.
A simple and powerful Node.js package that allows you to easily access all Pollinations features, including image generation and LLM capabilities, using their free API.
To install the pollinations package, use npm:
npm install pollinations
const Pollinations = require("pollinations");
const pollinations = new Pollinations();
// Generate an image
pollinations.images
.generateImage({
prompt: "A futuristic city at sunset",
model: "flux-anime",
width: 1024,
height: 768
})
.then(image => {
// Save the generated image
require("fs").writeFileSync("generated-image.png", image);
})
.catch(error => console.error(error));
To generate images, you can use the images namespace.
pollinations.images
.generateImage({
prompt: "A futuristic city skyline",
model: "flux",
width: 800,
height: 600
})
.then(imageBuffer => {
// Handle the generated image buffer here
})
.catch(error => {
console.error(error);
});
To generate text using LLM models, use the llm namespace.
pollinations.llm
.generateTextGet({
prompt: "Tell me a joke.",
model: "openai"
})
.then(text => {
console.log(text);
})
.catch(error => {
console.error(error);
});
getModels()
Fetches a list of available image generation models.
pollinations.images
.getModels()
.then(models => {
console.log(models);
})
.catch(error => {
console.error(error);
});
generateImage(options)
This method generates an image based on the provided options.
| Parameter | Type | Description |
|---|---|---|
options | Object | The options for image generation. |
options.prompt | string | The text prompt for image generation. |
options.model | string | The model to use for image generation (default is "flux"). |
options.seed | number | The seed for random generation (optional, default is null). |
options.width | number | The width of the generated image in pixels (default is 512). |
options.height | number | The height of the generated image in pixels (default is 512). |
options.nologo | boolean | Whether to remove the logo from the image (default is false). |
options.private | boolean | Whether the image is private (default is false). |
options.enhance | boolean | Whether to apply enhancement to the image (default is false). |
options.safe | boolean | Whether to apply safety filters to the image (default is false). |
getModels()
Fetches a list of available text generation models.
pollinations.llm
.getModels()
.then(models => {
console.log(models);
})
.catch(error => {
console.error(error);
});
generateTextGet(options)
Generates text based on the given prompt and options.
| Parameter | Type | Description |
|---|---|---|
options.prompt | string | The text prompt used for generating the content. |
options.model | string | Optional. The model to use for text generation (default is "openai"). |
options.seed | number | Optional. The seed for random generation (default is null). |
options.json | boolean | Optional. Whether to return the response as JSON (default is false). |
options.system | string | Optional. The system message (default is an empty string). |
generateTextPost(options)
Generates text based on the given messages and options.
| Parameter | Type | Description |
|---|---|---|
options.messages | Array | The array of messages to send as the conversation history. |
options.model | string | Optional. The model to use for text generation (default is "openai"). |
options.seed | number | Optional. The seed for random generation (default is null). |
options.jsonMode | boolean | Optional. Whether to return the response as JSON (default is false). |
To enable debugging, pass the debug option when creating a Pollinations instance:
const pollinations = new Pollinations({ debug: true });
When debugging is enabled, the package will log detailed information about API requests, responses, and warnings to the console.
This project is licensed under the Creative Commons Zero (CC0) License. You can modify, distribute, and use it freely, with no attribution required.
FAQs
A Node.js package that allows you to easily access all Pollinations features, including image generation and LLM capabilities, using their free API.
The npm package pollinations receives a total of 7 weekly downloads. As such, pollinations popularity was classified as not popular.
We found that pollinations demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

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.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.