Spaces:
Running
Running
Commit
·
d56c8ea
1
Parent(s):
b935b7f
Refactor AutoPipelineForText2Image initialization in lifespan function
Browse files
main.py
CHANGED
@@ -15,9 +15,9 @@ from diffusers import (
|
|
15 |
|
16 |
@asynccontextmanager
|
17 |
async def lifespan(app: FastAPI):
|
18 |
-
text2img = AutoPipelineForText2Image.from_pretrained(
|
19 |
-
"
|
20 |
-
)
|
21 |
|
22 |
img2img = AutoPipelineForImage2Image.from_pipe(text2img).to("cpu")
|
23 |
|
|
|
15 |
|
16 |
@asynccontextmanager
|
17 |
async def lifespan(app: FastAPI):
|
18 |
+
text2img = AutoPipelineForText2Image.from_pretrained("stabilityai/sdxl-turbo").to(
|
19 |
+
"cpu"
|
20 |
+
)
|
21 |
|
22 |
img2img = AutoPipelineForImage2Image.from_pipe(text2img).to("cpu")
|
23 |
|