boolean intermediate_outputs

This commit is contained in:
Brett Kuprel 2022-07-05 09:43:41 -04:00
parent ec2752dfae
commit 7d60a7e60f

View File

@ -14,18 +14,16 @@ class ReplicatePredictor(BasePredictor):
description='Text', description='Text',
default='Dali painting of WALL·E' default='Dali painting of WALL·E'
), ),
intermediate_outputs: bool = Input(
description='Whether to show intermediate outputs while running. This adds less than a second to the run time.',
default=True
),
grid_size: int = Input( grid_size: int = Input(
description='Size of the image grid', description='Size of the image grid',
ge=1, ge=1,
le=4, le=4,
default=4 default=4
), ),
log2_intermediate_image_count: int = Input(
description='Number of images to show while running, each adds a slight delay',
ge=0,
le=4,
default=2
),
log2_supercondition_factor: int = Input( log2_supercondition_factor: int = Input(
description='Higher values result in better agreement with the text but a narrower variety of generated images', description='Higher values result in better agreement with the text but a narrower variety of generated images',
ge=1, ge=1,
@ -34,11 +32,12 @@ class ReplicatePredictor(BasePredictor):
), ),
) -> Iterator[Path]: ) -> Iterator[Path]:
seed = -1 seed = -1
log2_mid_count = 3 if intermediate_outputs else 0
image_stream = self.model.generate_image_stream( image_stream = self.model.generate_image_stream(
text, text,
seed, seed,
grid_size=grid_size, grid_size=grid_size,
log2_mid_count=log2_intermediate_image_count, log2_mid_count=log2_mid_count,
log2_supercondition_factor=log2_supercondition_factor, log2_supercondition_factor=log2_supercondition_factor,
is_verbose=True is_verbose=True
) )