Skip to content

Commit

Permalink
fix(ui): ensure clip vision model is set correctly for FLUX IP Adapters
Browse files Browse the repository at this point in the history
  • Loading branch information
psychedelicious committed Nov 7, 2024
1 parent daf3fe1 commit f3553ba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ export const selectDefaultIPAdapter = createSelector(
const ipAdapter = deepClone(initialIPAdapter);
if (model) {
ipAdapter.model = zModelIdentifierField.parse(model);
if (model.base === 'flux') {
ipAdapter.clipVisionModel = 'ViT-L';
}
}
return ipAdapter;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ const addIPAdapter = (entity: CanvasReferenceImageState, g: Graph, collector: In
let ipAdapterNode: Invocation<'flux_ip_adapter' | 'ip_adapter'>;

if (model.base === 'flux') {
assert(clipVisionModel === 'ViT-L', 'ViT-L is the only supported CLIP Vision model for FLUX IP adapter');
assert(
clipVisionModel === 'ViT-L',
`ViT-L is the only supported CLIP Vision model for FLUX IP adapter, got ${clipVisionModel}`
);
ipAdapterNode = g.addNode({
id: `ip_adapter_${id}`,
type: 'flux_ip_adapter',
Expand Down

0 comments on commit f3553ba

Please sign in to comment.