Amaro2a commited on
Commit
ac80bb1
·
verified ·
1 Parent(s): 06f7549

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py CHANGED
@@ -7,6 +7,18 @@ from pydantic import BaseModel
7
  from starlette.responses import StreamingResponse
8
  from diffusers import StableDiffusionPipeline
9
  from peft import PeftModel
 
 
 
 
 
 
 
 
 
 
 
 
10
 
11
  # ==================================
12
  # Setup: App, Logging, Constants
 
7
  from starlette.responses import StreamingResponse
8
  from diffusers import StableDiffusionPipeline
9
  from peft import PeftModel
10
+ from fastapi.middleware.cors import CORSMiddleware
11
+
12
+
13
+
14
+
15
+ app.add_middleware(
16
+ CORSMiddleware,
17
+ allow_origins=["*"], # Or specify your frontend's URL
18
+ allow_credentials=True,
19
+ allow_methods=["*"],
20
+ allow_headers=["*"],
21
+ )
22
 
23
  # ==================================
24
  # Setup: App, Logging, Constants