@hautechai/sdk 2.42.0 → 2.43.1
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/README.md +49 -0
- package/dist/index.d.mts +440 -6
- package/dist/index.d.ts +440 -6
- package/dist/index.js +177 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +167 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -85,6 +85,55 @@ sdk.ws.disconnect();
|
|
|
85
85
|
|
|
86
86
|
Docs about how to use the SDK are available [here](https://docs.hautech.ai/)
|
|
87
87
|
|
|
88
|
+
#### Seedream v5 Lite imagine operations
|
|
89
|
+
|
|
90
|
+
```ts
|
|
91
|
+
// Text-to-image
|
|
92
|
+
const t2iOperation = await sdk.operations.run.imagine.seedream['5_lite_t2i'].v1({
|
|
93
|
+
input: {
|
|
94
|
+
prompt: 'A cinematic skyline at sunrise above a crystal bay',
|
|
95
|
+
width: 2048,
|
|
96
|
+
height: 2048,
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
// Image edit
|
|
101
|
+
const editOperation = await sdk.operations.run.imagine.seedream['5_lite_edit'].v1({
|
|
102
|
+
input: {
|
|
103
|
+
prompt: 'Reimagine this scene as a watercolor illustration',
|
|
104
|
+
imageIds: ['existing-image-id'],
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
// Wait for the generated assets
|
|
109
|
+
const finalizedT2i = await sdk.operations.wait(t2iOperation);
|
|
110
|
+
const finalizedEdit = await sdk.operations.wait(editOperation);
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Both variants accept dimensions up to 3072×3072. Pricing endpoints report a cost of **$0.04375 USD per run** for the text-to-image and edit models—use `sdk.pricing.list()` or `sdk.pricing.get('seedream.5_lite_t2i.v1')` / `sdk.pricing.get('seedream.5_lite_edit.v1')` to confirm the current catalog pricing.
|
|
114
|
+
|
|
115
|
+
#### Google Nano Banana prompt-only vs. edit mode
|
|
116
|
+
|
|
117
|
+
```ts
|
|
118
|
+
// Prompt-only generation (no source images required)
|
|
119
|
+
const promptOnly = await sdk.operations.run.google.nano_banana_pro.edit.v1({
|
|
120
|
+
input: {
|
|
121
|
+
prompt: 'Generate a high-fashion catalog shot of a model in neon streetwear',
|
|
122
|
+
// imageIds omitted on purpose
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
// Classic edit mode with at least one source image
|
|
127
|
+
const editFromImage = await sdk.operations.run.google.nano_banana_pro.edit.v1({
|
|
128
|
+
input: {
|
|
129
|
+
prompt: 'Apply a cinematic golden-hour lighting pass to this asset',
|
|
130
|
+
imageIds: ['existing-image-id'],
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
The backend Swagger DTO (`GoogleNanoBananaProEditV1Input`) intentionally marks `imageIds` as optional so prompt-only runs remain valid. Provide one or more IDs when you need edit behavior; omit the field when you want the model to generate a fresh asset purely from text.
|
|
136
|
+
|
|
88
137
|
### Uploading files
|
|
89
138
|
|
|
90
139
|
- In browsers, prefer passing a `File` object to methods like `sdk.images.createFromFile` and `sdk.videos.createFromFile`. The `File.name` will be included in the multipart upload automatically.
|