update cogrun.py
This commit is contained in:
parent
8fe5a6f7ef
commit
990b7da701
13
cogrun.py
13
cogrun.py
|
@ -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
|
Loading…
Reference in New Issue
Block a user