From 2fcbb79cd992d04fe1608591e73a3a41a0a6ea80 Mon Sep 17 00:00:00 2001 From: chenxwh Date: Sat, 4 May 2024 23:32:42 +0000 Subject: [PATCH] update --- README.md | 2 +- predict.py | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c399ed9..b9725d1 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@
## StoryDiffusion: Consistent Self-Attention for Long-Range Image and Video Generation [![Paper page](https://huggingface.co/datasets/huggingface/badges/resolve/main/paper-page-md-dark.svg)]() -[[Paper](https://arxiv.org/abs/2405.01434)]   [[Project Page](https://storydiffusion.github.io/)]   [[🤗 Comic Generation Demo ](https://huggingface.co/spaces/YupengZhou/StoryDiffusion)]
+[[Paper](https://arxiv.org/abs/2405.01434)]   [[Project Page](https://storydiffusion.github.io/)]   [[🤗 Comic Generation Demo ](https://huggingface.co/spaces/YupengZhou/StoryDiffusion)] [![Replicate](https://replicate.com/cjwbw/StoryDiffusion/badge)](https://replicate.com/cjwbw/StoryDiffusion)
diff --git a/predict.py b/predict.py index 3c7d667..0308dce 100644 --- a/predict.py +++ b/predict.py @@ -457,6 +457,7 @@ class Predictor(BasePredictor): self.pipe_realvision.enable_freeu(s1=0.6, s2=0.4, b1=1.1, b2=1.2) self.pipe_realvision.fuse_lora() + @torch.inference_mode() def predict( self, sd_model: str = Input( @@ -559,7 +560,7 @@ class Predictor(BasePredictor): default=768, ), num_steps: int = Input( - description="Number of sample steps", ge=25, le=50, default=50 + description="Number of sample steps", ge=20, le=50, default=25 ), guidance_scale: float = Input( description="Scale for classifier-free guidance", ge=0.1, le=10, default=5 @@ -569,20 +570,19 @@ class Predictor(BasePredictor): ), sa32_setting: float = Input( description="The degree of Paired Attention at 32 x 32 self-attention layers", - default=0.7, + default=0.5, ge=0, le=1.0, ), sa64_setting: float = Input( description="The degree of Paired Attention at 64 x 64 self-attention layers", - default=0.7, + default=0.5, ge=0, le=1.0, ), num_ids: int = Input( description="Number of id images in total images. This should not exceed total number of line-separated prompts", default=3, - choices=[2, 3, 4], ), output_format: str = Input( description="Format of the output images", @@ -776,4 +776,6 @@ class Predictor(BasePredictor): sample.save(output_filename, **save_params) output_paths.append(Path(output_filename)) + del pipe + return ModelOutput(comic=Path(comic_out), individual_images=output_paths)