1
0
Fork 0

add grid stage to chain def

This commit is contained in:
Sean Sube 2023-09-10 21:44:12 -05:00
parent dc812a4e06
commit 15b8a80f6d
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
2 changed files with 21 additions and 2 deletions

View File

@ -174,8 +174,17 @@ export interface Img2ImgStage {
params: Img2ImgParams;
}
export interface GridStage {
name: string;
type: 'blend-grid';
params: {
height: number;
width: number;
};
}
export interface ChainPipeline {
stages: Array<Txt2ImgStage | Img2ImgStage>;
stages: Array<Txt2ImgStage | Img2ImgStage | GridStage>;
}
/**

View File

@ -27,6 +27,7 @@ export function buildPipelineForTxt2ImgGrid(grid: PipelineGrid, model: ModelPara
type: 'source-txt2img',
params: {
...params,
...model,
[grid.columns.parameter]: column,
[grid.rows.parameter]: row,
},
@ -36,7 +37,16 @@ export function buildPipelineForTxt2ImgGrid(grid: PipelineGrid, model: ModelPara
}
}
// TODO: add final grid stage
pipeline.stages.push({
name: 'grid',
type: 'blend-grid',
params: {
...params,
...model,
height: grid.rows.values.length,
width: grid.columns.values.length,
},
});
return pipeline;
}