update replicate
This commit is contained in:
parent
b52892fb74
commit
107a86bd8a
|
@ -13,26 +13,12 @@ class ReplicatePredictor(BasePredictor):
|
||||||
|
|
||||||
def predict(
|
def predict(
|
||||||
self,
|
self,
|
||||||
text: str = Input(
|
text: str = Input(default='Dali painting of WALL·E'),
|
||||||
description='For long prompts, only the first 64 tokens will be used to generate the image.',
|
intermediate_outputs: bool = Input(default=True),
|
||||||
default='Dali painting of WALL·E'
|
grid_size: int = Input(ge=1, le=9, default=5),
|
||||||
),
|
log2_temperature: float = Input(ge=-3, le=3, default=1),
|
||||||
intermediate_outputs: bool = Input(
|
log2_top_k: int = Input(ge=0, le=14, default=7),
|
||||||
description='Whether to show intermediate outputs while running. This adds less than a second to the run time.',
|
log2_supercondition_factor: int = Input(ge=2, le=6, default=4)
|
||||||
default=True
|
|
||||||
),
|
|
||||||
grid_size: int = Input(
|
|
||||||
description='Size of the image grid. 5x5 takes around 16 seconds, 8x8 takes around 36 seconds',
|
|
||||||
ge=1,
|
|
||||||
le=8,
|
|
||||||
default=4
|
|
||||||
),
|
|
||||||
temperature: float = Input(
|
|
||||||
description='A higher temperature results in more variety.',
|
|
||||||
ge=0.01,
|
|
||||||
le=10,
|
|
||||||
default=2
|
|
||||||
),
|
|
||||||
) -> Iterator[Path]:
|
) -> Iterator[Path]:
|
||||||
try:
|
try:
|
||||||
image_stream = self.model.generate_image_stream(
|
image_stream = self.model.generate_image_stream(
|
||||||
|
@ -40,9 +26,9 @@ class ReplicatePredictor(BasePredictor):
|
||||||
seed = -1,
|
seed = -1,
|
||||||
grid_size = grid_size,
|
grid_size = grid_size,
|
||||||
log2_mid_count = 3 if intermediate_outputs else 0,
|
log2_mid_count = 3 if intermediate_outputs else 0,
|
||||||
temperature = temperature,
|
temperature = 2 ** log2_temperature,
|
||||||
supercondition_factor = 2 ** 4,
|
supercondition_factor = 2 ** log2_supercondition_factor,
|
||||||
top_k = 2 ** 8,
|
top_k = 2 ** log2_top_k,
|
||||||
is_verbose = True
|
is_verbose = True
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user