Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

text-to-image: replace nested dict by height and width properties in the input schema #1158

Merged
merged 5 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions packages/tasks/src/tasks/text-to-image/inference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ export interface TextToImageParameters {
* the text prompt, but values too high may cause saturation and other artifacts.
*/
guidance_scale?: number;
/**
* The height in pixels of the output image
*/
height?: number;
/**
* One prompt to guide what NOT to include in image generation.
*/
Expand All @@ -44,13 +48,17 @@ export interface TextToImageParameters {
*/
seed?: number;
/**
* The size in pixel of the output image
* @deprecated use {@link width} and {@link height} instead
*/
target_size?: TargetSize;
/**
* The width in pixels of the output image
*/
width?: number;
hanouticelina marked this conversation as resolved.
Show resolved Hide resolved
[property: string]: unknown;
}
/**
* The size in pixel of the output image
* @deprecated use {@link width} and {@link height} instead
*/
export interface TargetSize {
height: number;
Expand Down
11 changes: 10 additions & 1 deletion packages/tasks/src/tasks/text-to-image/spec/input.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,18 @@
"type": "integer",
"description": "The number of denoising steps. More denoising steps usually lead to a higher quality image at the expense of slower inference."
},
"width": {
"type": "integer",
"description": "The width in pixels of the output image"
},
"height": {
"type": "integer",
"description": "The height in pixels of the output image"
},

"target_size": {
"type": "object",
"description": "The size in pixel of the output image",
"description": "@deprecated use {@link width} and {@link height} instead",
"properties": {
"width": {
"type": "integer"
Expand Down
Loading