Update app.py
Browse files
app.py
CHANGED
|
@@ -21,7 +21,7 @@ MAX_SEED = np.iinfo(np.int32).max
|
|
| 21 |
|
| 22 |
|
| 23 |
# Initialize the pipeline and download the sd3 medium model
|
| 24 |
-
pipe = StableDiffusion3Pipeline.from_pretrained(
|
| 25 |
pipe.to(device)
|
| 26 |
|
| 27 |
# superprompt-v1
|
|
@@ -30,7 +30,7 @@ model = T5ForConditionalGeneration.from_pretrained("roborovski/superprompt-v1",
|
|
| 30 |
model.to(device)
|
| 31 |
|
| 32 |
# Define the image generation function
|
| 33 |
-
@spaces.GPU(duration=
|
| 34 |
def generate_image(prompt, enhance_prompt, negative_prompt, num_inference_steps, height, width, guidance_scale, seed, num_images_per_prompt):
|
| 35 |
if seed == 0:
|
| 36 |
seed = random.randint(1, 2**32-1)
|
|
|
|
| 21 |
|
| 22 |
|
| 23 |
# Initialize the pipeline and download the sd3 medium model
|
| 24 |
+
pipe = StableDiffusion3Pipeline.from_pretrained("stabilityai/stable-diffusion-3-medium-diffusers", torch_dtype=torch.float16)
|
| 25 |
pipe.to(device)
|
| 26 |
|
| 27 |
# superprompt-v1
|
|
|
|
| 30 |
model.to(device)
|
| 31 |
|
| 32 |
# Define the image generation function
|
| 33 |
+
@spaces.GPU(duration=90)
|
| 34 |
def generate_image(prompt, enhance_prompt, negative_prompt, num_inference_steps, height, width, guidance_scale, seed, num_images_per_prompt):
|
| 35 |
if seed == 0:
|
| 36 |
seed = random.randint(1, 2**32-1)
|