Next7years commited on
Commit
6dd78dc
1 Parent(s): 027f17b
Files changed (1) hide show
  1. main.py +8 -1
main.py CHANGED
@@ -1,8 +1,15 @@
1
  from fastapi import FastAPI
 
2
 
3
 
4
  app = FastAPI()
5
 
6
  @app.get("/")
7
  def read_root():
8
- return {"Hello": "World!"}
 
 
 
 
 
 
 
1
  from fastapi import FastAPI
2
+ from diffusers import StableDiffusionPipeline
3
 
4
 
5
  app = FastAPI()
6
 
7
  @app.get("/")
8
  def read_root():
9
+ return {"Hello": "World!"}
10
+
11
+ @app.post("/generate")
12
+ def generate_image(input: str):
13
+ model = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")
14
+
15
+ return {"image": "hello from the server", "input": input}