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

remove width and height inputs #2

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
24 changes: 12 additions & 12 deletions predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,7 @@ def predict(
default=None,
),
image: Path = Input(
description="Inital image to generate variations of.",
),
width: int = Input(
description="Width of output image. Maximum size is 1024x768 or 768x1024 because of memory limits",
choices=[128, 256, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960, 1024],
default=512,
),
height: int = Input(
description="Height of output image. Maximum size is 1024x768 or 768x1024 because of memory limits",
choices=[128, 256, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960, 1024],
default=512,
description="A starting image from which to generate variations (aka 'img2img')"
),
prompt_strength: float = Input(
description="Prompt strength when providing the image. 1.0 corresponds to full destruction of information in init image",
Expand All @@ -80,7 +70,14 @@ def predict(
),
scheduler: str = Input(
default="DPMSolverMultistep",
choices=["DDIM", "K_EULER", "DPMSolverMultistep", "K_EULER_ANCESTRAL", "PNDM", "KLMS"],
choices=[
"DDIM",
"K_EULER",
"DPMSolverMultistep",
"K_EULER_ANCESTRAL",
"PNDM",
"KLMS",
],
description="Choose a scheduler.",
),
seed: int = Input(
Expand All @@ -102,6 +99,9 @@ def predict(
generator = torch.Generator("cuda").manual_seed(seed)
output = pipe(
prompt=[prompt] * num_outputs if prompt is not None else None,
negative_prompt=[negative_prompt] * num_outputs
if negative_prompt is not None
else None,
guidance_scale=guidance_scale,
generator=generator,
num_inference_steps=num_inference_steps,
Expand Down