Update main.py
Browse files
main.py
CHANGED
@@ -24,14 +24,13 @@ def dummy(images, **kwargs):
|
|
24 |
|
25 |
pipe.safety_checker = dummy
|
26 |
|
27 |
-
@app.
|
28 |
def hello():
|
29 |
return "Hello, I'm Linlada"
|
30 |
|
31 |
|
32 |
-
@app.
|
33 |
-
def generate_image():
|
34 |
-
prompt = request.args.get('prompt')
|
35 |
image = pipe(prompt).images[0]
|
36 |
# Save the image
|
37 |
image.save('static/image.png')
|
|
|
24 |
|
25 |
pipe.safety_checker = dummy
|
26 |
|
27 |
+
@app.get("/")
|
28 |
def hello():
|
29 |
return "Hello, I'm Linlada"
|
30 |
|
31 |
|
32 |
+
@app.get("/gen/{prompt}")
|
33 |
+
def generate_image(prompt: str):
|
|
|
34 |
image = pipe(prompt).images[0]
|
35 |
# Save the image
|
36 |
image.save('static/image.png')
|