This document will guide developers on how to use the aonweb library to call the flux-schnell API, The fastest image generation model tailored for local development and personal use.
## Prerequisites
- Node.js environment
-`aonweb` library installed
- Valid Aonet APPID
## Basic Usage
### 1. Import Required Modules
```js
import{AI,AIOptions}from'aonweb';
```
### 2. Initialize AI Instance
```js
constai_options=newAIOptions({
appId:'your_app_id_here',
dev_mode:true
});
constaonweb=newAI(ai_options);
```
### 3. Prepare Input Data Example
```js
constdata={
input:{
"prompt":"black forest gateau cake spelling out the words \\"FLUXSCHNELL\\", tasty, food photography, dynamic shot",
"num_outputs":1,
"aspect_ratio":"1:1",
"output_format":"webp",
"output_quality":90
}
};
```
```js
constdata={
input:{
"num_outputs":1,
"prompt":"POV someone holding their hand up, stunning black forest mountains",
"aspect_ratio":"1:1",
"output_format":"webp",
"output_quality":90
}
};
```
```js
constdata={
input:{
"num_outputs":1,
"prompt":"3 magical wizards stand on a yellow table\\nOn the left, a wizard in black robes holds a sign that says ‘AI’\\nIn the middle, a witch in red robes holds a sign that says ‘is’\\nand on the right, a wizard in blue robes holds a sign that says ‘cool’\\nBehind them a purple dragon",
-`num_outputs`: Number, Number of outputs to generate.
-`prompt`: String, Prompt for generated image.
-`aspect_ratio`: String, Aspect ratio for the generated image.
-`output_format`: String, Format of the output images.
-`output_quality`: Number,Quality when saving the output images, from 0 to 100. 100 is best quality, 0 is lowest quality. Not relevant for .png outputs
### Notes
- The API may take some time to process the input and generate the result, consider implementing appropriate wait or loading states.
- Handle possible errors, such as network issues, invalid input, or API limitations.
### Example Response
The API response will contain the URL of the generated image or other relevant information. Parse and use the response data according to the actual API documentation.
This document will guide developers on how to use the aonweb library to call the XTTS-V2 API, which is used for voice cloning and text-to-speech conversion.
## Prerequisites
- Node.js environment
-`aonweb` library installed
- Valid Aonet APPID
## Basic Usage
### 1. Import Required Modules
```js
import{AI,AIOptions}from'aonweb';
```
### 2. Initialize AI Instance
```js
constai_options=newAIOptions({
appId:'your_app_id_here',
dev_mode:true
});
constaonweb=newAI(ai_options);
```
### 3. Prepare Input Data Example
```js
constdata={
input:{
"text":"Hi there, I'm your new voice clone. Try your best to upload quality audio",
-`text`: String, the text content to be converted into speech.
-`speaker`: String, the URL of the audio file used as the voice sample for cloning.
-`language`: String, specifies the language of the text, with "en" indicating English.
-`cleanup_voice`: Boolean, whether to perform cleanup processing on the generated voice.
### Notes
- Ensure that the provided audio URL is publicly accessible and of good quality to achieve the best cloning effect.
- The API may take some time to process the input and generate the result, consider implementing appropriate wait or loading states.
- Handle possible errors, such as network issues, invalid input, or API limitations.
- Adhere to the terms of use and privacy regulations, especially when handling voice samples of others.
### Example Response
The API response will contain the URL of the generated cloned voice or other relevant information. Parse and use the response data according to the actual API documentation.