Spaces:
Runtime error
Runtime error
File size: 1,384 Bytes
f1b2ef2 07da480 d2a2d86 af85b79 d68b387 7b86905 af85b79 ca2a4e0 efac16f 7f2257d f1b2ef2 ca2a4e0 f1b2ef2 7f2257d f1b2ef2 07da480 d2a2d86 d68b387 ed57be9 f1b2ef2 ed57be9 51c84d5 ed57be9 07da480 ca2a4e0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from routers import sdxl_text_to_image
from routers import painting
import logfire
logfire.configure(pydantic_plugin=logfire.PydanticPlugin(record='all'))
app = FastAPI(openapi_url='/api/v1/product-diffusion/openapi.json',docs_url='/api/v1/product_diffusion/docs')
app.add_middleware(
CORSMiddleware,
allow_origins = ["*"],
allow_methods = ["*"],
allow_headers=["*"],
allow_credentials = True
)
app.include_router(sdxl_text_to_image.router, prefix='/api/v1/product-diffusion')
app.include_router(painting.router,prefix='/api/v1/product-diffusion')
logfire.instrument_fastapi(app)
@app.get('/')
async def root():
return {
'message': 'Welcome to the main API Page for the product Photography Application , we provide APIs for building Stunning Product Images with Diffusion Models',
'description': 'This API provides endpoints for accessing and managing product diffusion data.',
'version': '1.0.0',
'author': 'Vikramjeet Singh',
'contact': {
'email': 'singh.vikram.1782000@gmail.com',
'github': 'https://github.com/vikramxD',
'website': 'https://vikramxd.github.io'
},
'license': 'MIT',
}
@app.get("/health")
def check_health():
return {"status": "ok"}
|