Update main.py
Browse files
main.py
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
import Linlada
|
2 |
from fastapi import FastAPI
|
3 |
from fastapi.middleware.cors import CORSMiddleware
|
4 |
-
from diffusions import StableDiffusionPipeline
|
5 |
|
6 |
app = FastAPI()
|
7 |
|
@@ -13,17 +12,6 @@ app.add_middleware( # add the middleware
|
|
13 |
allow_headers=["*"], # allow all headers
|
14 |
)
|
15 |
|
16 |
-
|
17 |
-
model_id = "runwayml/stable-diffusion-v1-5"
|
18 |
-
pipe = StableDiffusionPipeline.from_pretrained(model_id, use_auth_token=auth_token)
|
19 |
-
pipe = pipe.to("cpu")
|
20 |
-
pipe.enable_attention_slicing()
|
21 |
-
|
22 |
-
def dummy(images, **kwargs):
|
23 |
-
return images, False
|
24 |
-
|
25 |
-
pipe.safety_checker = dummy
|
26 |
-
|
27 |
@app.get("/")
|
28 |
def hello():
|
29 |
return "Hello, I'm Artist"
|
|
|
1 |
import Linlada
|
2 |
from fastapi import FastAPI
|
3 |
from fastapi.middleware.cors import CORSMiddleware
|
|
|
4 |
|
5 |
app = FastAPI()
|
6 |
|
|
|
12 |
allow_headers=["*"], # allow all headers
|
13 |
)
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
@app.get("/")
|
16 |
def hello():
|
17 |
return "Hello, I'm Artist"
|