Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -63,10 +63,11 @@ tokenizer_3 = AutoTokenizer.from_pretrained(
|
|
63 |
|
64 |
# Ensure model and scheduler are initialized in GPU-enabled function
|
65 |
if torch.cuda.is_available():
|
66 |
-
pipe = StableDiffusion3Pipeline.from_pretrained(repo, vae=vae, transformer=transformer,
|
67 |
-
pipe2 = StableDiffusion3Img2ImgPipeline.from_pretrained(repo, vae=vae, transformer=transformer,
|
68 |
|
69 |
pipe.scheduler = FlowMatchEulerDiscreteScheduler.from_config(pipe.scheduler.config)
|
|
|
70 |
pipe2.scheduler = FlowMatchEulerDiscreteScheduler.from_config(pipe.scheduler.config)
|
71 |
|
72 |
# Function
|
|
|
63 |
|
64 |
# Ensure model and scheduler are initialized in GPU-enabled function
|
65 |
if torch.cuda.is_available():
|
66 |
+
pipe = StableDiffusion3Pipeline.from_pretrained(repo, vae=vae, transformer=transformer, tokenizer_3=tokenizer_3, text_encoder_3=text_encoder_3, torch_dtype=torch.float16).to("cuda")
|
67 |
+
pipe2 = StableDiffusion3Img2ImgPipeline.from_pretrained(repo, vae=vae, transformer=transformer, tokenizer_3=tokenizer_3, text_encoder_3=text_encoder_3, torch_dtype=torch.float16).to("cuda")
|
68 |
|
69 |
pipe.scheduler = FlowMatchEulerDiscreteScheduler.from_config(pipe.scheduler.config)
|
70 |
+
pipe.tokenizer_max_length = 512
|
71 |
pipe2.scheduler = FlowMatchEulerDiscreteScheduler.from_config(pipe.scheduler.config)
|
72 |
|
73 |
# Function
|