1
0
Fork 0

pass initial device to chain

This commit is contained in:
Sean Sube 2023-09-10 22:46:06 -05:00
parent fb7a0996a8
commit 51b10de265
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
7 changed files with 11 additions and 7 deletions

View File

@ -108,7 +108,6 @@ class ChainPipeline:
len(sources),
)
else:
sources = [None]
logger.info("running pipeline without source images")
stage_sources = sources

View File

@ -519,7 +519,7 @@ def blend_loras(
t_weights = interp_to_match(weights, onnx_weights).transpose()
blended = onnx_weights + t_weights
logger.debug(
logger.trace(
"blended weight shape: %s, %s", blended.shape, onnx_weights.dtype
)

View File

@ -60,5 +60,7 @@ type: object
additionalProperties: False
required: [stages]
properties:
platform:
type: string
stages:
$ref: "#/$defs/request_chain"

View File

@ -431,9 +431,12 @@ export function makeClient(root: string, token: Maybe<string> = undefined, f = f
}
};
},
async chain(chain: ChainPipeline): Promise<ImageResponse> {
async chain(model: ModelParams, chain: ChainPipeline): Promise<ImageResponse> {
const url = makeApiUrl(root, 'chain');
const body = JSON.stringify(chain);
const body = JSON.stringify({
...chain,
platform: model.platform,
});
// eslint-disable-next-line no-return-await
return await parseRequest(url, {

View File

@ -39,7 +39,7 @@ export const LOCAL_CLIENT = {
async outpaint(model, params, upscale) {
throw new NoServerError();
},
async chain(chain) {
async chain(model, chain) {
throw new NoServerError();
},
async noises() {

View File

@ -387,7 +387,7 @@ export interface ApiClient {
*/
blend(model: ModelParams, params: BlendParams, upscale?: UpscaleParams): Promise<ImageResponseWithRetry>;
chain(chain: ChainPipeline): Promise<ImageResponse>;
chain(model: ModelParams, chain: ChainPipeline): Promise<ImageResponse>;
/**
* Check whether job has finished and its output is ready.

View File

@ -30,7 +30,7 @@ export function Txt2Img() {
if (grid.enabled) {
const chain = buildPipelineForTxt2ImgGrid(grid, model, params2, upscale, highres);
const image = await client.chain(chain);
const image = await client.chain(model, chain);
pushHistory(image);
} else {
const { image, retry } = await client.txt2img(model, params2, upscale, highres);