-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(gui): add local params and API stub so client can load without a…
… server (#181)
- Loading branch information
Showing
11 changed files
with
365 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"version": "0.7.1", | ||
"version": "0.8.0", | ||
"batch": { | ||
"default": 1, | ||
"min": 1, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { BaseError } from 'noicejs'; | ||
import { ApiClient } from './api.js'; | ||
|
||
export class NoServerError extends BaseError { | ||
constructor() { | ||
super('cannot connect to server'); | ||
} | ||
} | ||
|
||
/** | ||
* @TODO client-side inference with https://www.npmjs.com/package/onnxruntime-web | ||
*/ | ||
export const LOCAL_CLIENT = { | ||
async masks() { | ||
throw new NoServerError(); | ||
}, | ||
async blend(model, params, upscale) { | ||
throw new NoServerError(); | ||
}, | ||
async img2img(model, params, upscale) { | ||
throw new NoServerError(); | ||
}, | ||
async txt2img(model, params, upscale) { | ||
throw new NoServerError(); | ||
}, | ||
async inpaint(model, params, upscale) { | ||
throw new NoServerError(); | ||
}, | ||
async upscale(model, params, upscale) { | ||
throw new NoServerError(); | ||
}, | ||
async outpaint(model, params, upscale) { | ||
throw new NoServerError(); | ||
}, | ||
async noises() { | ||
throw new NoServerError(); | ||
}, | ||
async params() { | ||
throw new NoServerError(); | ||
}, | ||
async ready(key) { | ||
throw new NoServerError(); | ||
}, | ||
async cancel(key) { | ||
throw new NoServerError(); | ||
}, | ||
async models() { | ||
throw new NoServerError(); | ||
}, | ||
async platforms() { | ||
throw new NoServerError(); | ||
}, | ||
async schedulers() { | ||
throw new NoServerError(); | ||
}, | ||
async strings() { | ||
return {}; | ||
}, | ||
} as ApiClient; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.