
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
Official SDK of [Imaginepro](https://platform.imaginepro.ai/), your professional AI image generation platform with enterprise-grade stability and scalability.
Official SDK of Imaginepro, your professional AI image generation platform with enterprise-grade stability and scalability.
Imaginepro offers state-of-the-art AI image generation capabilities with:
npm i imaginepro -S
import ImagineProSDK from 'imaginepro';
const instance = new ImagineProSDK({
apiKey: 'sk-xxxx',
baseUrl: 'https://api.imaginepro.ai', // Optional, defaults to 'https://api.imaginepro.ai'
timeout: 300000, // Optional, defaults to 30 minutes (in milliseconds)
});
(async () => {
try {
const result = await instance.imagine({
prompt: 'a pretty cat playing with a puppy',
});
console.log('Image generation initiated:', result);
const imagine = await instance.fetchMessage(result.messageId);
console.log('Image generation result:', imagine);
} catch (error) {
console.error('Error:', error);
}
})();
The imagine method allows you to generate an image based on a text prompt.
const imagineResponse = await instance.imagine({
prompt: 'a futuristic cityscape at sunset',
});
console.log('Imagine response:', imagineResponse);
The pressButton method allows you to interact with buttons associated with a message. You can specify the messageId, button identifier.
const buttonResponse = await instance.pressButton({
messageId: 'your-message-id',
button: 'U1',
});
console.log('Button press response:', buttonResponse);
The upscale method allows you to upscale an image by interacting with the button 'U1' using the provided messageId and index.
const buttonResponse = await instance.upscale({
messageId: 'your-message-id',
index: 1, // Corresponds to button 'U1'
});
console.log('Upscale response:', buttonResponse);
The variant method allows you to generate a variant of an image by interacting with a variant button using the provided messageId and index.
const buttonResponse = await instance.variant({
messageId: 'your-message-id',
index: 1, // Corresponds to button 'V1'
});
console.log('Variant response:', buttonResponse);
The reroll method allows you to regenerate an image using the provided messageId.
const rerollResponse = await instance.reroll({
messageId: 'your-message-id',
});
console.log('Reroll response:', rerollResponse);
The inpainting method allows you to vary a specific region of an image using the provided messageId and mask. You can create mask by this tool
const inpaintingResponse = await instance.inpainting({
messageId: 'your-message-id',
mask: 'xxx',
});
console.log('Inpainting response:', inpaintingResponse);
The fetchMessage method allows you to retrieve the status and details of a specific message using its messageId. This method polls the message status until it is either DONE or FAIL.
const messageResponse = await instance.fetchMessage('your-message-id');
console.log('Message response:', messageResponse);
messageId (string): The unique identifier for the message.interval (number, optional): The polling interval in milliseconds. Defaults to 2000ms.timeout (number, optional): The maximum time to wait for the message status in milliseconds. Defaults to 30 minutes.A MessageResponse object containing details such as the status, progress, and generated image URL (if successful).
(async () => {
try {
const messageResponse = await instance.fetchMessage('your-message-id');
console.log('Message details:', messageResponse);
} catch (error) {
console.error('Error fetching message:', error);
}
})();
You can use the optional parameters ref and webhookOverride to customize the behavior of the SDK when generating images.
ref: A reference ID that will be sent to the webhook for tracking purposes.webhookOverride: A custom webhook URL to receive callbacks for generation results.Example:
const imagineResponse = await instance.imagine({
prompt: 'a serene mountain landscape',
ref: 'custom-reference-id', // Optional reference ID
webhookOverride: 'https://your-custom-webhook.url/callback', // Optional custom webhook URL
});
console.log('Imagine response with webhook:', imagineResponse);
When using webhookOverride, the generation result will be sent to the specified webhook URL instead of the default one configured in your account.
The webhook payload will include details exactly the same as the response of fetchMessage.
The ImagineProSDK constructor accepts the following options:
apiKey (string, required): Your API key for authentication.baseUrl (string, optional): The base URL for the API. Defaults to https://api.imaginepro.ai.defaultTimeout (number, optional): The default timeout for requests in milliseconds. Defaults to 30 minutes (1800000ms).fetchInterval (number, optional): The interval for polling the message status in milliseconds. Defaults to 2000ms.const sdk = new ImagineProSDK({
apiKey: 'your-api-key',
baseUrl: 'https://api.custom-url.com', // Optional
defaultTimeout: 60000, // Optional, 1 minute
fetchInterval: 1000, // Optional, 1 second
});
The MessageResponse object contains details about the status and result of a message.
messageId (string): The unique identifier for the message.prompt (string): The prompt used for image generation.originalUrl (string, optional): The original image URL.uri (string, optional): The generated image URL.progress (number): The progress percentage of the task.status (string): The current status of the message. Possible values are:
PROCESSINGQUEUEDDONEFAILcreatedAt (string, optional): The timestamp when the message was created.updatedAt (string, optional): The timestamp when the message was last updated.buttons (string[], optional): The available action buttons for the message.originatingMessageId (string, optional): The ID of the originating message, if applicable.ref (string, optional): Reference information provided during the request.error (string, optional): The error message, if the task fails.const messageResponse: MessageResponse = {
messageId: 'abc123',
prompt: 'a futuristic cityscape at sunset',
uri: 'https://cdn.imaginepro.ai/generated-image.jpg',
progress: 100,
status: 'DONE',
createdAt: '2023-01-01T00:00:00Z',
updatedAt: '2023-01-01T00:05:00Z',
buttons: ['U1', 'V1'],
ref: 'custom-reference-id',
};
console.log('Message Response:', messageResponse);
FAQs
Official SDK of [Imaginepro](https://platform.imaginepro.ai/), your professional AI image generation platform with enterprise-grade stability and scalability.
We found that imaginepro demonstrated a healthy version release cadence and project activity because the last version was released less than 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.