refac
This commit is contained in:
@@ -112,7 +112,6 @@ async def get_image_model(request):
|
|||||||
options = await r.json()
|
options = await r.json()
|
||||||
return options['sd_model_checkpoint']
|
return options['sd_model_checkpoint']
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
request.app.state.config.ENABLE_IMAGE_GENERATION = False
|
|
||||||
raise HTTPException(status_code=400, detail=ERROR_MESSAGES.DEFAULT(e))
|
raise HTTPException(status_code=400, detail=ERROR_MESSAGES.DEFAULT(e))
|
||||||
|
|
||||||
|
|
||||||
@@ -330,7 +329,6 @@ async def verify_url(request: Request, user=Depends(get_admin_user)):
|
|||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
return True
|
return True
|
||||||
except Exception:
|
except Exception:
|
||||||
request.app.state.config.ENABLE_IMAGE_GENERATION = False
|
|
||||||
raise HTTPException(status_code=400, detail=ERROR_MESSAGES.INVALID_URL)
|
raise HTTPException(status_code=400, detail=ERROR_MESSAGES.INVALID_URL)
|
||||||
elif request.app.state.config.IMAGE_GENERATION_ENGINE == 'comfyui':
|
elif request.app.state.config.IMAGE_GENERATION_ENGINE == 'comfyui':
|
||||||
headers = None
|
headers = None
|
||||||
@@ -346,7 +344,6 @@ async def verify_url(request: Request, user=Depends(get_admin_user)):
|
|||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
return True
|
return True
|
||||||
except Exception:
|
except Exception:
|
||||||
request.app.state.config.ENABLE_IMAGE_GENERATION = False
|
|
||||||
raise HTTPException(status_code=400, detail=ERROR_MESSAGES.INVALID_URL)
|
raise HTTPException(status_code=400, detail=ERROR_MESSAGES.INVALID_URL)
|
||||||
else:
|
else:
|
||||||
return True
|
return True
|
||||||
@@ -427,7 +424,6 @@ async def get_models(request: Request, user=Depends(get_verified_user)):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
request.app.state.config.ENABLE_IMAGE_GENERATION = False
|
|
||||||
raise HTTPException(status_code=400, detail=ERROR_MESSAGES.DEFAULT(e))
|
raise HTTPException(status_code=400, detail=ERROR_MESSAGES.DEFAULT(e))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user