Skip to content

Add seed in text to image specs #888

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

Merged
merged 2 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
14 changes: 9 additions & 5 deletions packages/tasks/src/tasks/text-to-image/inference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,27 @@ export interface TextToImageInput {
*/
export interface TextToImageParameters {
/**
* 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.
* A higher guidance scale value encourages the model to generate images closely linked to
* the text prompt, but values too high may cause saturation and other artifacts.
*/
guidance_scale?: number;
/**
* One or several prompt to guide what NOT to include in image generation.
*/
negative_prompt?: string[];
/**
* For diffusion models. The number of denoising steps. More denoising steps usually lead to
* a higher quality image at the expense of slower inference.
* The number of denoising steps. More denoising steps usually lead to a higher quality
* image at the expense of slower inference.
*/
num_inference_steps?: number;
/**
* For diffusion models. Override the scheduler with a compatible one
* Override the scheduler with a compatible one.
*/
scheduler?: string;
/**
* Seed for the random number generator.
*/
seed?: number;
/**
* The size in pixel of the output image
*/
Expand Down
10 changes: 7 additions & 3 deletions packages/tasks/src/tasks/text-to-image/spec/input.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"properties": {
"guidance_scale": {
"type": "number",
"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."
"description": "A higher guidance scale value encourages the model to generate images closely linked to the text prompt, but values too high may cause saturation and other artifacts."
},
"negative_prompt": {
"type": "array",
Expand All @@ -33,7 +33,7 @@
},
"num_inference_steps": {
"type": "integer",
"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."
"description": "The number of denoising steps. More denoising steps usually lead to a higher quality image at the expense of slower inference."
},
"target_size": {
"type": "object",
Expand All @@ -50,7 +50,11 @@
},
"scheduler": {
"type": "string",
"description": "For diffusion models. Override the scheduler with a compatible one"
"description": "Override the scheduler with a compatible one."
},
"seed": {
"type": "integer",
"description": "Seed for the random number generator."
}
}
}
Expand Down
Loading