
Security News
Open Source Maintainers Feeling the Weight of the EU’s Cyber Resilience Act
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
ideogram.js
Advanced tools
A node.js module that allows you to easily generate images using the Ideogram's API.
A Node.js package that allows you to easily generate images from Ideogram.
This npm package is created for educational and research purposes. By using this package, you agree to do so at your own risk. This package is not affiliated, endorsed, or sponsored by Ideogram in any way.
Install ideogram.js to your project with npm:
npm install ideogram.js
A session cookie is required for ideogram.js to work. To get yours, follow these steps :
F12
key (or Option + ⌘ + J
for Mac users) on your keyboard.Application
-> Cookies
-> https://ideogram.ai/
and copy the value of the cookie called session_cookie
.You can now send your first request to the Ideogram website!
const Ideogram = require("ideogram.js")
const ideogram = new Ideogram("SESSION_COOKIE_GOES_HERE")
ideogram.generate({
prompt: "Abstract expressionism of Mentoring and self development , 3d render, photo, wildlife photography, dark fantasy, cinematic",
aspect_ratio: "square"
})
.then(result =>{
console.log(result)
// ... do whatever you want with the result
})
.catch(error =>{
return console.log(error)
})
const Ideogram = require("ideogram.js")
const ideogram = new Ideogram(session_cookie)
Parameter | Type | Default | Description |
---|---|---|---|
session_cookie | string | N/A | Your session cookie (REQUIRED) |
ideogram.generate(generationOptions).then(result).catch(error)
The ideogram.generate()
sends a request to the Ideogram website to start a generation; It takes an Object
parameter and return an Object
.
Parameter (from Object) | Type | Default | Description |
---|---|---|---|
prompt | string | N/A | (REQUIRED) Description of the image(s) to generate |
aspect_ratio | string | N/A | (REQUIRED) Aspect ratio of the images to generate (accepted values are square , portrait or landscape ) |
Result (Object) | Type | Description |
---|---|---|
Object.success | boolean | true if the request was successful, false otherwise |
Object.message | string or null | Not null if Object.success is false , string explaining the error |
Object.user_id | string | Your Ideogram user ID |
Object.prompt | string | The prompt used in the request |
Object.request_id | string | The ID of the request. The request ID can be used to get information sata about a generation (status, images, etc) |
Object.aspect_ratio | string | The aspect ratio used in the request |
ideogram.getGeneration(generationId).then(result).catch(error)
The ideogram.getGeneration()
sends a request to the Ideogram website to get information about a generation; It takes a String
parameter and return an Object
.
Parameter | Type | Default | Description |
---|---|---|---|
generationId | string | N/A | (REQUIRED) Id of the generation you want to fetch |
Result (Object) | Type | Description |
---|---|---|
Object.success | boolean | true if the request was successful, false otherwise |
Object.message | string or null | Not null if Object.success is false , string explaining the error |
Object.request_id | string | Id of the generation |
Object.status | string | Status of the generation (can either be COMPLETED or GENERATING ) |
Object.prompt | string | The prompt used for the generation |
Object.aspect_ratio | string | The aspect ratio of the generation |
Object.has_started | boolean | Whether the generation has started or not |
Object.resolution | number | The current resolution of the images (1024 indicated the generation is completed) |
Object.height | string | The height of the images |
Object.width | string | The width of the images |
Object.images | Array or null | Array of Objects . If this value is null , it means the generation has started but the website it not yet returning images |
Image (Object.images) | Type | Description |
---|---|---|
Image.response_id | string | The ID of the image |
Object.hasLiked | boolean | true if you liked the image, false otherwise |
Object.likes | number | How many users liked your image |
Object.url | string | A direct URL to the image |
If you're having issues with Ideogram.js or want to share your projects, ideas or feedbacks, you can join my support server!
FAQs
A node.js module that allows you to easily generate images using the Ideogram's API.
The npm package ideogram.js receives a total of 0 weekly downloads. As such, ideogram.js popularity was classified as not popular.
We found that ideogram.js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.