Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit bf48f5e

Browse files
committedJan 26, 2024
Update image-to-image inputs
1 parent 499ed5f commit bf48f5e

File tree

2 files changed

+78
-4
lines changed

2 files changed

+78
-4
lines changed
 

‎packages/tasks/src/tasks/image-to-image/inference.ts

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* Using src/scripts/inference-codegen
55
*/
66

7-
export type ImageToImageOutput = unknown[];
8-
97
/**
108
* Inputs for Image To Image inference
119
*/
@@ -17,6 +15,53 @@ export interface ImageToImageInput {
1715
/**
1816
* Additional inference parameters
1917
*/
20-
parameters?: unknown;
18+
parameters?: ImageToImageParameters;
19+
[property: string]: unknown;
20+
}
21+
22+
/**
23+
* Additional inference parameters
24+
*
25+
* Additional inference parameters for Image To Image
26+
*/
27+
export interface ImageToImageParameters {
28+
/**
29+
* For diffusion models. A higher guidance scale value encourages the model to generate
30+
* images closely linked to the text prompt at the expense of lower image quality.
31+
*/
32+
guidanceScale?: number;
33+
/**
34+
* One or several prompt to guide what NOT to include in image generation.
35+
*/
36+
negativePrompt?: string[];
37+
/**
38+
* For diffusion models. The number of denoising steps. More denoising steps usually lead to
39+
* a higher quality image at the expense of slower inference.
40+
*/
41+
numInferenceSteps?: number;
42+
/**
43+
* The size in pixel of the output image
44+
*/
45+
targetSize?: TargetSize;
46+
[property: string]: unknown;
47+
}
48+
49+
/**
50+
* The size in pixel of the output image
51+
*/
52+
export interface TargetSize {
53+
height: number;
54+
width: number;
55+
[property: string]: unknown;
56+
}
57+
58+
/**
59+
* Outputs of inference for the Image To Image task
60+
*/
61+
export interface ImageToImageOutput {
62+
/**
63+
* The output image
64+
*/
65+
image?: unknown;
2166
[property: string]: unknown;
2267
}

‎packages/tasks/src/tasks/image-to-image/spec/input.json

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,36 @@
1616
"$defs": {
1717
"ImageToImageParameters": {
1818
"title": "ImageToImageParameters",
19-
"description": "Additional inference parameters for Image To Image"
19+
"description": "Additional inference parameters for Image To Image",
20+
"type": "object",
21+
"properties": {
22+
"guidanceScale": {
23+
"type": "number",
24+
"description": "For diffusion models. A higher guidance scale value encourages the model to generate images closely linked to the text prompt at the expense of lower image quality."
25+
},
26+
"negativePrompt": {
27+
"type": "array",
28+
"items": { "type": "string" },
29+
"description": "One or several prompt to guide what NOT to include in image generation."
30+
},
31+
"numInferenceSteps": {
32+
"type": "integer",
33+
"description": "For diffusion models. The number of denoising steps. More denoising steps usually lead to a higher quality image at the expense of slower inference."
34+
},
35+
"targetSize": {
36+
"type": "object",
37+
"description": "The size in pixel of the output image",
38+
"properties": {
39+
"width": {
40+
"type": "integer"
41+
},
42+
"height": {
43+
"type": "integer"
44+
}
45+
},
46+
"required": ["width", "height"]
47+
}
48+
}
2049
}
2150
},
2251
"required": ["data"]

0 commit comments

Comments
 (0)
Please sign in to comment.