Skip to content

Commit

Permalink
fix(ui): allow image dims multiple of 32 with SDXL and T2I adapter
Browse files Browse the repository at this point in the history
See #6342 (comment) for discussion.
  • Loading branch information
psychedelicious committed May 17, 2024
1 parent 32dff2c commit 4584ed9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions invokeai/frontend/web/src/common/hooks/useIsReadyToEnqueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,12 @@ const createSelector = (templates: Templates) =>
} else if (l.controlAdapter.processorConfig && !l.controlAdapter.processedImage) {
problems.push(i18n.t('parameters.invoke.layer.controlAdapterImageNotProcessed'));
}
// T2I Adapters require images have dimensions that are multiples of 64
if (l.controlAdapter.type === 't2i_adapter' && (size.width % 64 !== 0 || size.height % 64 !== 0)) {
problems.push(i18n.t('parameters.invoke.layer.t2iAdapterIncompatibleDimensions'));
// T2I Adapters require images have dimensions that are multiples of 64 (SD1.5) or 32 (SDXL)
if (l.controlAdapter.type === 't2i_adapter') {
const multiple = model?.base === 'sdxl' ? 32 : 64;
if (size.width % multiple !== 0 || size.height % multiple !== 0) {
problems.push(i18n.t('parameters.invoke.layer.t2iAdapterIncompatibleDimensions'));
}
}
}

Expand Down

0 comments on commit 4584ed9

Please sign in to comment.