diff --git a/apps/node/src/modules/model-manager/civitai.ts b/apps/node/src/modules/model-manager/civitai.ts index ca3a62da..ab7fe25c 100644 --- a/apps/node/src/modules/model-manager/civitai.ts +++ b/apps/node/src/modules/model-manager/civitai.ts @@ -32,7 +32,7 @@ export async function searchCivitModelFromSHA256(sha256: string) { export async function getCivitModelById(modelId: string) { const headers = resolveCivitHeaders(); - const ret = await proxyFetch(`https://api.civitai.com/v1/model?modelId=${modelId}`, { + const ret = await proxyFetch(`https://api.civitai.com/v1/models/${modelId}`, { headers, }) const data = await ret.json() diff --git a/apps/node/src/routes/api/bootstrap.ts b/apps/node/src/routes/api/bootstrap.ts index 8828da78..591bcaf0 100644 --- a/apps/node/src/routes/api/bootstrap.ts +++ b/apps/node/src/routes/api/bootstrap.ts @@ -32,7 +32,7 @@ export async function ApiEnvCheck(req: Request, res: Response) { success: false, error: err.message + err.stack }) - } + } } /** diff --git a/apps/node/src/routes/api/models.ts b/apps/node/src/routes/api/models.ts index 13094ce5..44844243 100644 --- a/apps/node/src/routes/api/models.ts +++ b/apps/node/src/routes/api/models.ts @@ -98,6 +98,7 @@ export async function ApiRouteInstallModel(req: Request, res: Response) { export async function ApiGetCivitaiModels(req: Request, res: Response) { try { const params = req.body + console.log("modelId", params); if (params.modelId) { const ret = await getCivitModelById(params.modelId) res.send({ @@ -106,6 +107,7 @@ export async function ApiGetCivitaiModels(req: Request, res: Response) { }); return } + if (params.hash) { const ret = await getCivitModelByHash(params.hash) res.send({ diff --git a/packages/common/store/model.state.ts b/packages/common/store/model.state.ts index 9eafa342..3fc3508d 100644 --- a/packages/common/store/model.state.ts +++ b/packages/common/store/model.state.ts @@ -281,7 +281,7 @@ async function getCivitModels(currentPage: number, pageSize: number, filters: an } export const getCivitModelByModelId = _.memoize(async (modelId: string): Promise => { - const api = getBackendUrl("/api/civit/models"); + const api = getBackendUrl("/api/civitai/models"); const ret = await fetch(api, { method: "POST", headers: {