All URIs are relative to http://localhost
| Method | HTTP request | Description |
|---|---|---|
| cacheModelApiDbCachePost | POST /api/db/cache | Cache Model |
| getFileApiDbFilesFileIdGet | GET /api/db/files/{file_id} | Get File |
| getModelApiDbModelsCivitaiIdGet | GET /api/db/models/{civitai_id} | Get Model |
| getStatsApiDbStatsGet | GET /api/db/stats | Get Stats |
| getTriggersByPathApiDbTriggersGet | GET /api/db/triggers | Get Triggers By Path |
| getTriggersByVersionApiDbTriggersVersionIdGet | GET /api/db/triggers/{version_id} | Get Triggers By Version |
| linkFilesApiDbLinkPost | POST /api/db/link | Link Files |
| listFilesApiDbFilesGet | GET /api/db/files | List Files |
| scanDirectoryApiDbScanPost | POST /api/db/scan | Scan Directory |
| searchModelsApiDbModelsGet | GET /api/db/models | Search Models |
{ [key: string]: any; } cacheModelApiDbCachePost(cacheRequest)
Cache Model
Fetch and cache full CivitAI model data.
import {
Configuration,
DatabaseApi,
} from '@saiden/tensors';
import type { CacheModelApiDbCachePostRequest } from '@saiden/tensors';
async function example() {
console.log("π Testing @saiden/tensors SDK...");
const config = new Configuration({
// To configure API key authorization: APIKeyHeader
apiKey: "YOUR API KEY",
// To configure API key authorization: APIKeyQuery
apiKey: "YOUR API KEY",
});
const api = new DatabaseApi(config);
const body = {
// CacheRequest
cacheRequest: ...,
} satisfies CacheModelApiDbCachePostRequest;
try {
const data = await api.cacheModelApiDbCachePost(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);| Name | Type | Description | Notes |
|---|---|---|---|
| cacheRequest | CacheRequest |
{ [key: string]: any; }
- Content-Type:
application/json - Accept:
application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
{ [key: string]: any; } getFileApiDbFilesFileIdGet(fileId)
Get File
Get local file by ID.
import { Configuration, DatabaseApi } from '@saiden/tensors'
import type { GetFileApiDbFilesFileIdGetRequest } from '@saiden/tensors'
async function example() {
console.log('π Testing @saiden/tensors SDK...')
const config = new Configuration({
// To configure API key authorization: APIKeyHeader
apiKey: 'YOUR API KEY',
// To configure API key authorization: APIKeyQuery
apiKey: 'YOUR API KEY',
})
const api = new DatabaseApi(config)
const body = {
// number
fileId: 56,
} satisfies GetFileApiDbFilesFileIdGetRequest
try {
const data = await api.getFileApiDbFilesFileIdGet(body)
console.log(data)
} catch (error) {
console.error(error)
}
}
// Run the test
example().catch(console.error)| Name | Type | Description | Notes |
|---|---|---|---|
| fileId | number |
[Defaults to undefined] |
{ [key: string]: any; }
- Content-Type: Not defined
- Accept:
application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
{ [key: string]: any; } getModelApiDbModelsCivitaiIdGet(civitaiId)
Get Model
Get cached model by CivitAI ID.
import { Configuration, DatabaseApi } from '@saiden/tensors'
import type { GetModelApiDbModelsCivitaiIdGetRequest } from '@saiden/tensors'
async function example() {
console.log('π Testing @saiden/tensors SDK...')
const config = new Configuration({
// To configure API key authorization: APIKeyHeader
apiKey: 'YOUR API KEY',
// To configure API key authorization: APIKeyQuery
apiKey: 'YOUR API KEY',
})
const api = new DatabaseApi(config)
const body = {
// number
civitaiId: 56,
} satisfies GetModelApiDbModelsCivitaiIdGetRequest
try {
const data = await api.getModelApiDbModelsCivitaiIdGet(body)
console.log(data)
} catch (error) {
console.error(error)
}
}
// Run the test
example().catch(console.error)| Name | Type | Description | Notes |
|---|---|---|---|
| civitaiId | number |
[Defaults to undefined] |
{ [key: string]: any; }
- Content-Type: Not defined
- Accept:
application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
{ [key: string]: any; } getStatsApiDbStatsGet()
Get Stats
Get database statistics.
import { Configuration, DatabaseApi } from '@saiden/tensors'
import type { GetStatsApiDbStatsGetRequest } from '@saiden/tensors'
async function example() {
console.log('π Testing @saiden/tensors SDK...')
const config = new Configuration({
// To configure API key authorization: APIKeyHeader
apiKey: 'YOUR API KEY',
// To configure API key authorization: APIKeyQuery
apiKey: 'YOUR API KEY',
})
const api = new DatabaseApi(config)
try {
const data = await api.getStatsApiDbStatsGet()
console.log(data)
} catch (error) {
console.error(error)
}
}
// Run the test
example().catch(console.error)This endpoint does not need any parameter.
{ [key: string]: any; }
- Content-Type: Not defined
- Accept:
application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Array<string | null> getTriggersByPathApiDbTriggersGet(filePath)
Get Triggers By Path
Get trigger words for a local file by path.
import { Configuration, DatabaseApi } from '@saiden/tensors'
import type { GetTriggersByPathApiDbTriggersGetRequest } from '@saiden/tensors'
async function example() {
console.log('π Testing @saiden/tensors SDK...')
const config = new Configuration({
// To configure API key authorization: APIKeyHeader
apiKey: 'YOUR API KEY',
// To configure API key authorization: APIKeyQuery
apiKey: 'YOUR API KEY',
})
const api = new DatabaseApi(config)
const body = {
// string | Path to safetensor file
filePath: filePath_example,
} satisfies GetTriggersByPathApiDbTriggersGetRequest
try {
const data = await api.getTriggersByPathApiDbTriggersGet(body)
console.log(data)
} catch (error) {
console.error(error)
}
}
// Run the test
example().catch(console.error)| Name | Type | Description | Notes |
|---|---|---|---|
| filePath | string |
Path to safetensor file | [Defaults to undefined] |
Array<string | null>
- Content-Type: Not defined
- Accept:
application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Array<string | null> getTriggersByVersionApiDbTriggersVersionIdGet(versionId)
Get Triggers By Version
Get trigger words for a version by CivitAI version ID.
import { Configuration, DatabaseApi } from '@saiden/tensors'
import type { GetTriggersByVersionApiDbTriggersVersionIdGetRequest } from '@saiden/tensors'
async function example() {
console.log('π Testing @saiden/tensors SDK...')
const config = new Configuration({
// To configure API key authorization: APIKeyHeader
apiKey: 'YOUR API KEY',
// To configure API key authorization: APIKeyQuery
apiKey: 'YOUR API KEY',
})
const api = new DatabaseApi(config)
const body = {
// number
versionId: 56,
} satisfies GetTriggersByVersionApiDbTriggersVersionIdGetRequest
try {
const data = await api.getTriggersByVersionApiDbTriggersVersionIdGet(body)
console.log(data)
} catch (error) {
console.error(error)
}
}
// Run the test
example().catch(console.error)| Name | Type | Description | Notes |
|---|---|---|---|
| versionId | number |
[Defaults to undefined] |
Array<string | null>
- Content-Type: Not defined
- Accept:
application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
{ [key: string]: any; } linkFilesApiDbLinkPost()
Link Files
Link unlinked local files to CivitAI by hash lookup.
import { Configuration, DatabaseApi } from '@saiden/tensors'
import type { LinkFilesApiDbLinkPostRequest } from '@saiden/tensors'
async function example() {
console.log('π Testing @saiden/tensors SDK...')
const config = new Configuration({
// To configure API key authorization: APIKeyHeader
apiKey: 'YOUR API KEY',
// To configure API key authorization: APIKeyQuery
apiKey: 'YOUR API KEY',
})
const api = new DatabaseApi(config)
try {
const data = await api.linkFilesApiDbLinkPost()
console.log(data)
} catch (error) {
console.error(error)
}
}
// Run the test
example().catch(console.error)This endpoint does not need any parameter.
{ [key: string]: any; }
- Content-Type: Not defined
- Accept:
application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Array<{ [key: string]: any; }> listFilesApiDbFilesGet()
List Files
List all local files with CivitAI info.
import { Configuration, DatabaseApi } from '@saiden/tensors'
import type { ListFilesApiDbFilesGetRequest } from '@saiden/tensors'
async function example() {
console.log('π Testing @saiden/tensors SDK...')
const config = new Configuration({
// To configure API key authorization: APIKeyHeader
apiKey: 'YOUR API KEY',
// To configure API key authorization: APIKeyQuery
apiKey: 'YOUR API KEY',
})
const api = new DatabaseApi(config)
try {
const data = await api.listFilesApiDbFilesGet()
console.log(data)
} catch (error) {
console.error(error)
}
}
// Run the test
example().catch(console.error)This endpoint does not need any parameter.
Array<{ [key: string]: any; }>
- Content-Type: Not defined
- Accept:
application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
{ [key: string]: any; } scanDirectoryApiDbScanPost(scanRequest)
Scan Directory
Scan directory for safetensor files and add to database.
import {
Configuration,
DatabaseApi,
} from '@saiden/tensors';
import type { ScanDirectoryApiDbScanPostRequest } from '@saiden/tensors';
async function example() {
console.log("π Testing @saiden/tensors SDK...");
const config = new Configuration({
// To configure API key authorization: APIKeyHeader
apiKey: "YOUR API KEY",
// To configure API key authorization: APIKeyQuery
apiKey: "YOUR API KEY",
});
const api = new DatabaseApi(config);
const body = {
// ScanRequest
scanRequest: ...,
} satisfies ScanDirectoryApiDbScanPostRequest;
try {
const data = await api.scanDirectoryApiDbScanPost(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);| Name | Type | Description | Notes |
|---|---|---|---|
| scanRequest | ScanRequest |
{ [key: string]: any; }
- Content-Type:
application/json - Accept:
application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Array<{ [key: string]: any; }> searchModelsApiDbModelsGet(query, type, base, limit)
Search Models
Search cached models offline.
import { Configuration, DatabaseApi } from '@saiden/tensors'
import type { SearchModelsApiDbModelsGetRequest } from '@saiden/tensors'
async function example() {
console.log('π Testing @saiden/tensors SDK...')
const config = new Configuration({
// To configure API key authorization: APIKeyHeader
apiKey: 'YOUR API KEY',
// To configure API key authorization: APIKeyQuery
apiKey: 'YOUR API KEY',
})
const api = new DatabaseApi(config)
const body = {
// string | Search query (optional)
query: query_example,
// string | Model type filter (optional)
type: type_example,
// string | Base model filter (optional)
base: base_example,
// number | Max results (optional)
limit: 56,
} satisfies SearchModelsApiDbModelsGetRequest
try {
const data = await api.searchModelsApiDbModelsGet(body)
console.log(data)
} catch (error) {
console.error(error)
}
}
// Run the test
example().catch(console.error)| Name | Type | Description | Notes |
|---|---|---|---|
| query | string |
Search query | [Optional] [Defaults to undefined] |
| type | string |
Model type filter | [Optional] [Defaults to undefined] |
| base | string |
Base model filter | [Optional] [Defaults to undefined] |
| limit | number |
Max results | [Optional] [Defaults to 20] |
Array<{ [key: string]: any; }>
- Content-Type: Not defined
- Accept:
application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]