Skip to content

Allow arbitrary aspect ratio in IFSuperResolutionPipeline #3298

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 4 commits into from
May 17, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,8 @@ def preprocess_image(self, image, num_images_per_prompt, device):
def __call__(
self,
prompt: Union[str, List[str]] = None,
height: int = None,
width: int = None,
image: Union[PIL.Image.Image, np.ndarray, torch.FloatTensor] = None,
num_inference_steps: int = 50,
timesteps: List[int] = None,
Expand All @@ -720,6 +722,10 @@ def __call__(
prompt (`str` or `List[str]`, *optional*):
The prompt or prompts to guide the image generation. If not defined, one has to pass `prompt_embeds`.
instead.
height (`int`, *optional*, defaults to self.unet.config.sample_size):
The height in pixels of the generated image.
width (`int`, *optional*, defaults to self.unet.config.sample_size):
The width in pixels of the generated image.
image (`PIL.Image.Image`, `np.ndarray`, `torch.FloatTensor`):
The image to be upscaled.
num_inference_steps (`int`, *optional*, defaults to 50):
Expand Down Expand Up @@ -806,8 +812,8 @@ def __call__(

# 2. Define call parameters

height = self.unet.config.sample_size
width = self.unet.config.sample_size
height = height or self.unet.config.sample_size
width = width or self.unet.config.sample_size

device = self._execution_device

Expand Down