update cogrun.py

This commit is contained in:
Brett Kuprel 2022-07-04 22:05:32 -04:00
parent 8fe5a6f7ef
commit 990b7da701

View File

@ -29,12 +29,12 @@ class Predictor(BasePredictor):
intermediate_image_count: int = Input( intermediate_image_count: int = Input(
description='Set the number of intermediate images to show while running', description='Set the number of intermediate images to show while running',
choices=[1, 2, 4, 8, 16], choices=[1, 2, 4, 8, 16],
default=8 default=4
), ),
supercondition_factor: int = Input( supercondition_factor: int = Input(
description='Lower results in a wider variety of images but less agreement with the text', description='Lower results in a wider variety of images but less agreement with the text',
choices=[2, 4, 8, 16, 32, 64], choices=[2, 4, 8, 16, 32, 64],
default=8 default=16
), ),
) -> Iterator[Path]: ) -> Iterator[Path]:
image_stream = self.model.generate_image_stream( image_stream = self.model.generate_image_stream(
@ -46,7 +46,10 @@ class Predictor(BasePredictor):
is_verbose=True is_verbose=True
) )
iter = 0
path = Path(tempfile.mkdtemp())
for image in image_stream: for image in image_stream:
path = Path(tempfile.mkdtemp()) / 'output.jpg' iter += 1
image.save(str(path)) image_path = path / 'min-dalle-iter-{}.jpg'.format(iter)
yield path image.save(str(image_path))
yield image_path