-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodel_search.py
30 lines (23 loc) · 999 Bytes
/
model_search.py
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
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from omniinfer_client import OmniClient, ModelType
# get your api key refer to https://docs.omniinfer.io/get-started/
client = OmniClient(os.getenv('OMNI_API_KEY'))
# filter by model type
print("lora count", len(client.models().filter_by_type(ModelType.LORA)))
print("checkpoint count", len(client.models().filter_by_type(ModelType.CHECKPOINT)))
print("textinversion count", len(
client.models().filter_by_type(ModelType.TEXT_INVERSION)))
print("vae count", len(client.models().filter_by_type(ModelType.VAE)))
print("controlnet count", len(client.models().filter_by_type(ModelType.CONTROLNET)))
# filter by civitai tags
client.models().filter_by_civi_tags('anime')
# filter by nsfw
client.models().filter_by_nsfw(False) # or True
# sort by civitai download
client.models().sort_by_civitai_download()
# chain filters
client.models().\
filter_by_type(ModelType.CHECKPOINT).\
filter_by_nsfw(False).\
filter_by_civitai_tags('anime')