Skip to content

Commit

Permalink
Add get fooocus styles api
Browse files Browse the repository at this point in the history
  • Loading branch information
konieshadow committed Oct 25, 2023
1 parent 65edfd2 commit da6d273
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,7 @@ Get all filenames of base model and lora.
#### Refresh Models
> POST /v1/engines/refresh-models
Refresh local files and get all filenames of base model and lora.
#### Get All Fooocus Styles
> GET /v1/engines/styles
Get all legal Fooocus styles.
23 changes: 23 additions & 0 deletions docs/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,29 @@
}
}
}
},
"/v1/engines/styles": {
"get": {
"summary": "All Styles",
"description": "Get all legal Fooocus styles",
"operationId": "all_styles_v1_engines_styles_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"items": {
"type": "string"
},
"type": "array",
"title": "Response All Styles V1 Engines Styles Get"
}
}
}
}
}
}
}
},
"components": {
Expand Down
2 changes: 1 addition & 1 deletion fooocus_api_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = '0.2.3'
version = '0.2.4'
6 changes: 6 additions & 0 deletions fooocusapi/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,12 @@ def refresh_models():
path.update_all_model_names()
return AllModelNamesResponse(model_filenames=path.model_filenames, lora_filenames=path.lora_filenames)


@app.get("/v1/engines/styles", response_model=List[str], description="Get all legal Fooocus styles")
def all_styles():
from modules.sdxl_styles import legal_style_names
return legal_style_names

def start_app(args):
uvicorn.run("fooocusapi.api:app", host=args.host,
port=args.port, log_level=args.log_level)

0 comments on commit da6d273

Please sign in to comment.