This repository was archived by the owner on Feb 4, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.d.ts
63 lines (57 loc) · 1.74 KB
/
main.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/**
* ProdiaAI is a class for handling ProdiaAI images.
*/
declare class ProdiaAI {
private readonly key: string
/**
* Initializes a ProdiaAI instance.
* @param {Object} obj - Initialization parameters object.
* @param {String} obj.key - Your API key.
*/
constructor(key: string)
/**
* Creates an AI image job.
* @param {Object} config - Image job configuration.
* @param {String} config.prompt - Image prompt.
* @param {String} config.negative_prompt - Negative image prompt.
* @param {Number} config.steps - Number of image generation steps.
* @param {Number} config.cfg_scale - Image generation scale.
* @param {String} config.sampler - Image generation sampler.
* @param {String} config.model - Image generation model.
* @returns {Promise<Object>} - Promise with the API response content.
*/
createJob(config: {
prompt: string
negative_prompt: string
steps: number
cfg_scale: number
sampler: string
model: string
}): Promise<{
job: string;
status: string;
}>
/**
* Retrieves information about a specific job ID.
* @param {String} jobId - Job ID.
* @returns {Promise<Object>} - Promise with the API response content.
*/
getJob(jobId: string): Promise<{
job: string,
status: string,
imageUrl: string
}>
/**
* Get a list of current available models.
* @returns {Promise<string[]>} - Promise with the API response content.
*/
getModels(): Promise<string[]>
}
/**
* Creates an instance of ProdiaAI.
* @param {string} key - The API key used for authentication.
* @returns {ProdiaAI} The ProdiaAI instance.
* @throws {Error} If the API key is missing.
*/
declare function createProdiaAI(key: string) : ProdiaAI
export default createProdiaAI