A TypeScript client for the getimg.ai API.
Generate stunning images with the latest AI models — fully typed, zero hassle.
npm install getimg-clientimport { getimg } from 'getimg-client';
getimg.config({ key: 'YOUR_GETIMG_API_KEY' });
const result = await getimg.models.seedreamV4.textToImage({
prompt: 'A futuristic city at sunset, cinematic lighting',
aspect_ratio: '16:9',
response_format: 'url',
});
console.log(result.data?.url);Generates 4K high-quality images from a text prompt.
const result = await getimg.models.seedreamV4.textToImage({
prompt: 'Astronaut riding a horse on Mars, photorealistic',
aspect_ratio: '16:9',
seed: 42,
response_format: 'url', // 'url' | 'b64'
});Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
prompt |
string |
— | Text description of the image (required) |
aspect_ratio |
string |
1:1 |
1:1 · 16:9 · 9:16 · 3:2 · 2:3 · 3:4 · 4:3 · 21:9 |
seed |
number |
— | Fix seed for reproducible results |
response_format |
string |
b64 |
url or b64 |
Fast, high-quality text-to-image generation.
const result = await getimg.models.fluxSchnell.textToImage({
prompt: 'A serene mountain lake at dawn',
width: 1024,
height: 1024,
steps: 4,
response_format: 'url',
});Parameters
| Parameter | Type | Description |
|---|---|---|
prompt |
string |
Text description of the image (required) |
width |
number |
Output image width in pixels |
height |
number |
Output image height in pixels |
steps |
number |
Number of diffusion steps |
seed |
number |
Fix seed for reproducible results |
output_format |
string |
jpeg or png |
response_format |
string |
url or b64 |
// List all available models
const { data } = await getimg.listAllModels();
// Filter by family or pipeline
const { data } = await getimg.listAllModels({
family: 'seedream-v4',
pipeline: 'text-to-image',
});Example response
[
{
"id": "stable-diffusion-v1-5",
"name": "Stable Diffusion v1.5",
"family": "stable-diffusion",
"pipelines": ["text-to-image", "image-to-image", "controlnet"],
"base_resolution": { "width": 512, "height": 512 },
"price": 0.00045,
"created_at": "2023-05-23T18:51:22.297Z"
}
]const { data } = await getimg.retrieveModel({ id: 'stable-diffusion-v1-5' });
console.log(data?.name);const { data } = await getimg.account.retrieveBalance();
console.log(`Balance: $${data?.amount}`);Warning
The following model families are deprecated legacy endpoints. They remain functional but are no longer recommended. Migrate to seedreamV4 or fluxSchnell for new projects.
View legacy models
textToImage · imageToImage · controlNet · inpainting · instruct
textToImage · imageToImage · inpainting · ipAdapter
textToImage
textToImage · imageToImage
upscale · fixFaces
// Legacy usage example
const result = await getimg.models.stableDiffusion.textToImage({
prompt: 'A beautiful landscape',
});Contributions are welcome!
- Fork the repository
- Create a new branch:
git checkout -b feature/my-feature - Commit your changes:
git commit -m 'feat: add my feature' - Push and open a pull request