@aigne/ideogram 0.3.5 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/README.md +66 -4
- package/lib/cjs/ideogram-image-model.d.ts +1 -0
- package/lib/cjs/ideogram-image-model.js +3 -1
- package/lib/dts/ideogram-image-model.d.ts +1 -0
- package/lib/esm/ideogram-image-model.d.ts +1 -0
- package/lib/esm/ideogram-image-model.js +3 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.3.6](https://github.com/AIGNE-io/aigne-framework/compare/ideogram-v0.3.5...ideogram-v0.3.6) (2025-09-01)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Dependencies
|
|
7
|
+
|
|
8
|
+
* The following workspace dependencies were updated
|
|
9
|
+
* dependencies
|
|
10
|
+
* @aigne/core bumped to 1.57.5
|
|
11
|
+
|
|
3
12
|
## [0.3.5](https://github.com/AIGNE-io/aigne-framework/compare/ideogram-v0.3.4...ideogram-v0.3.5) (2025-08-30)
|
|
4
13
|
|
|
5
14
|
|
package/README.md
CHANGED
|
@@ -20,7 +20,6 @@ AIGNE Ideogram SDK for integrating with Ideogram's image generation models and A
|
|
|
20
20
|
|
|
21
21
|
`@aigne/ideogram` provides a seamless integration between the AIGNE Framework and Ideogram's powerful image generation models and APIs. This package enables developers to easily leverage Ideogram's advanced image generation capabilities in their AIGNE applications, providing a consistent interface across the framework while taking advantage of Ideogram's state-of-the-art image synthesis technology.
|
|
22
22
|
|
|
23
|
-
|
|
24
23
|
## Installation
|
|
25
24
|
|
|
26
25
|
### Using npm
|
|
@@ -51,6 +50,7 @@ const model = new IdeogramImageModel({
|
|
|
51
50
|
});
|
|
52
51
|
|
|
53
52
|
const result = await model.invoke({
|
|
53
|
+
model: "ideogram-v3",
|
|
54
54
|
prompt: "A serene mountain landscape at sunset with golden light",
|
|
55
55
|
});
|
|
56
56
|
|
|
@@ -63,12 +63,70 @@ console.log(result);
|
|
|
63
63
|
}
|
|
64
64
|
],
|
|
65
65
|
usage: {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
66
|
+
inputTokens: 0,
|
|
67
|
+
outputTokens: 0
|
|
68
|
+
},
|
|
69
|
+
model: "ideogram-v3"
|
|
69
70
|
}
|
|
70
71
|
*/
|
|
71
72
|
```
|
|
73
|
+
|
|
74
|
+
## Input Parameters
|
|
75
|
+
|
|
76
|
+
The `IdeogramImageModel` supports the following input parameters:
|
|
77
|
+
|
|
78
|
+
### Required Parameters
|
|
79
|
+
|
|
80
|
+
- **`prompt`** (string): The text description of the image you want to generate.
|
|
81
|
+
|
|
82
|
+
### Optional Parameters
|
|
83
|
+
|
|
84
|
+
- **`model`** (string): only support ideogram-v3
|
|
85
|
+
- **`n`** (number): Number of images to generate (1-8, defaults to 1)
|
|
86
|
+
- **`seed`** (number): Random seed for reproducible generation (0 to 2147483647)
|
|
87
|
+
- **`resolution`** (string): Image resolution (e.g., "1024x1024", "1792x1024")
|
|
88
|
+
- **`aspectRatio`** (string): Aspect ratio for image generation (e.g., "1x1", "16x9")
|
|
89
|
+
- **`renderingSpeed`** (string): Generation speed - "TURBO", "DEFAULT", or "QUALITY"
|
|
90
|
+
- **`magicPrompt`** (string): Enable/disable MagicPrompt - "AUTO", "ON", or "OFF"
|
|
91
|
+
- **`negativePrompt`** (string): Description of what to exclude from the image
|
|
92
|
+
- **`colorPalette`** (object): Color palette for generation
|
|
93
|
+
- **`styleCodes`** (string[]): List of 8-character hexadecimal style codes
|
|
94
|
+
- **`styleType`** (string): Style type - "AUTO", "GENERAL", "REALISTIC", "DESIGN", or "FICTION"
|
|
95
|
+
|
|
96
|
+
### Reference Parameters
|
|
97
|
+
|
|
98
|
+
For complete parameter details, supported resolutions, aspect ratios, and advanced features, refer to the [Ideogram API Reference](https://developer.ideogram.ai/api-reference/api-reference/generate-v3).
|
|
99
|
+
|
|
100
|
+
### Advanced Usage Example
|
|
101
|
+
|
|
102
|
+
```typescript
|
|
103
|
+
const result = await model.invoke({
|
|
104
|
+
prompt: "A futuristic cityscape with neon lights and flying cars",
|
|
105
|
+
model: "ideogram-v3",
|
|
106
|
+
n: 4,
|
|
107
|
+
resolution: "1792x1024",
|
|
108
|
+
renderingSpeed: "TURBO",
|
|
109
|
+
styleType: "FICTION",
|
|
110
|
+
negativePrompt: "blurry, low quality, distorted",
|
|
111
|
+
seed: 12345
|
|
112
|
+
});
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Model Options
|
|
116
|
+
|
|
117
|
+
You can also set default options when creating the model:
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
const model = new IdeogramImageModel({
|
|
121
|
+
apiKey: "your-api-key",
|
|
122
|
+
modelOptions: {
|
|
123
|
+
styleType: "REALISTIC",
|
|
124
|
+
renderingSpeed: "QUALITY",
|
|
125
|
+
magicPrompt: "ON"
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
```
|
|
129
|
+
|
|
72
130
|
## Environment Variables
|
|
73
131
|
|
|
74
132
|
Set the following environment variable for automatic API key detection:
|
|
@@ -77,6 +135,10 @@ Set the following environment variable for automatic API key detection:
|
|
|
77
135
|
export IDEOGRAM_API_KEY="your-ideogram-api-key"
|
|
78
136
|
```
|
|
79
137
|
|
|
138
|
+
## API Reference
|
|
139
|
+
|
|
140
|
+
For complete parameter details, supported resolutions, aspect ratios, and advanced features, refer to the [Ideogram API Reference](https://developer.ideogram.ai/api-reference/api-reference/generate-v3).
|
|
141
|
+
|
|
80
142
|
## License
|
|
81
143
|
|
|
82
144
|
Elastic-2.0
|
|
@@ -26,6 +26,7 @@ export declare class IdeogramImageModel extends ImageModel<IdeogramImageModelInp
|
|
|
26
26
|
get credential(): {
|
|
27
27
|
url: string;
|
|
28
28
|
apiKey: string | undefined;
|
|
29
|
+
model: string;
|
|
29
30
|
};
|
|
30
31
|
get modelOptions(): Omit<Partial<IdeogramImageModelInput>, "model"> | undefined;
|
|
31
32
|
/**
|
|
@@ -7,6 +7,7 @@ const type_utils_js_1 = require("@aigne/core/utils/type-utils.js");
|
|
|
7
7
|
const ufo_1 = require("ufo");
|
|
8
8
|
const zod_1 = require("zod");
|
|
9
9
|
const IDEOGRAM_BASE_URL = "https://api.ideogram.ai";
|
|
10
|
+
const IDEOGRAM_DEFAULT_IMAGE_MODEL = "ideogram-v3";
|
|
10
11
|
const ideogramImageModelInputSchema = core_1.imageModelInputSchema.extend({});
|
|
11
12
|
const ideogramImageModelOptionsSchema = zod_1.z.object({
|
|
12
13
|
apiKey: zod_1.z.string().optional(),
|
|
@@ -31,6 +32,7 @@ class IdeogramImageModel extends core_1.ImageModel {
|
|
|
31
32
|
return {
|
|
32
33
|
url: this.options?.baseURL || process.env.IDEOGRAM_BASE_URL || IDEOGRAM_BASE_URL,
|
|
33
34
|
apiKey: this.options?.apiKey || process.env[this.apiKeyEnvName],
|
|
35
|
+
model: this.options?.model || IDEOGRAM_DEFAULT_IMAGE_MODEL,
|
|
34
36
|
};
|
|
35
37
|
}
|
|
36
38
|
get modelOptions() {
|
|
@@ -42,7 +44,7 @@ class IdeogramImageModel extends core_1.ImageModel {
|
|
|
42
44
|
* @returns The generated response
|
|
43
45
|
*/
|
|
44
46
|
async process(input) {
|
|
45
|
-
const model = input.model;
|
|
47
|
+
const model = input.model || this.credential.model;
|
|
46
48
|
const formData = new FormData();
|
|
47
49
|
if (model !== "ideogram-v3") {
|
|
48
50
|
throw new Error(`${this.name} only support ideogram-v3`);
|
|
@@ -26,6 +26,7 @@ export declare class IdeogramImageModel extends ImageModel<IdeogramImageModelInp
|
|
|
26
26
|
get credential(): {
|
|
27
27
|
url: string;
|
|
28
28
|
apiKey: string | undefined;
|
|
29
|
+
model: string;
|
|
29
30
|
};
|
|
30
31
|
get modelOptions(): Omit<Partial<IdeogramImageModelInput>, "model"> | undefined;
|
|
31
32
|
/**
|
|
@@ -26,6 +26,7 @@ export declare class IdeogramImageModel extends ImageModel<IdeogramImageModelInp
|
|
|
26
26
|
get credential(): {
|
|
27
27
|
url: string;
|
|
28
28
|
apiKey: string | undefined;
|
|
29
|
+
model: string;
|
|
29
30
|
};
|
|
30
31
|
get modelOptions(): Omit<Partial<IdeogramImageModelInput>, "model"> | undefined;
|
|
31
32
|
/**
|
|
@@ -4,6 +4,7 @@ import { checkArguments, pick } from "@aigne/core/utils/type-utils.js";
|
|
|
4
4
|
import { joinURL } from "ufo";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
const IDEOGRAM_BASE_URL = "https://api.ideogram.ai";
|
|
7
|
+
const IDEOGRAM_DEFAULT_IMAGE_MODEL = "ideogram-v3";
|
|
7
8
|
const ideogramImageModelInputSchema = imageModelInputSchema.extend({});
|
|
8
9
|
const ideogramImageModelOptionsSchema = z.object({
|
|
9
10
|
apiKey: z.string().optional(),
|
|
@@ -28,6 +29,7 @@ export class IdeogramImageModel extends ImageModel {
|
|
|
28
29
|
return {
|
|
29
30
|
url: this.options?.baseURL || process.env.IDEOGRAM_BASE_URL || IDEOGRAM_BASE_URL,
|
|
30
31
|
apiKey: this.options?.apiKey || process.env[this.apiKeyEnvName],
|
|
32
|
+
model: this.options?.model || IDEOGRAM_DEFAULT_IMAGE_MODEL,
|
|
31
33
|
};
|
|
32
34
|
}
|
|
33
35
|
get modelOptions() {
|
|
@@ -39,7 +41,7 @@ export class IdeogramImageModel extends ImageModel {
|
|
|
39
41
|
* @returns The generated response
|
|
40
42
|
*/
|
|
41
43
|
async process(input) {
|
|
42
|
-
const model = input.model;
|
|
44
|
+
const model = input.model || this.credential.model;
|
|
43
45
|
const formData = new FormData();
|
|
44
46
|
if (model !== "ideogram-v3") {
|
|
45
47
|
throw new Error(`${this.name} only support ideogram-v3`);
|
package/package.json
CHANGED
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"ufo": "^1.6.1",
|
|
38
|
-
"@aigne/core": "1.57.
|
|
38
|
+
"@aigne/core": "1.57.5"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/bun": "^1.2.18",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"typescript": "^5.8.3",
|
|
48
48
|
"zod": "3.25.67"
|
|
49
49
|
},
|
|
50
|
-
"version": "0.3.
|
|
50
|
+
"version": "0.3.6",
|
|
51
51
|
"scripts": {
|
|
52
52
|
"lint": "tsc --noEmit",
|
|
53
53
|
"build": "tsc --build scripts/tsconfig.build.json",
|