Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

1.1 KB
Raw Blame
import type { ModelConfig } from '@features/models';

import { describe, expect, it } from 'vitest';

import { getReidentifyPendingControlModels } from './controlModelOptions';

const model = (key: string, base: string, type: string, cond_in_channels: number | null): ModelConfig =>
  ({ base, cond_in_channels, key, name: key, type }) as ModelConfig;

describe('getReidentifyPendingControlModels', () => {
  const models = [
    model('sketch', 'anima', 'controlnet', 3),
    model('inpainting', 'anima', 'controlnet', 4),
    model('unidentified', 'anima', 'controlnet', null),
    model('sdxl-unknown', 'sdxl', 'controlnet', null),
    model('anima-lora', 'anima', 'lora', null),
  ];

  it('lists only Anima adapters of unknown type, and only for an Anima main model', () => {
    expect(getReidentifyPendingControlModels(models, 'anima').map((candidate) => candidate.key)).toEqual([
      'unidentified',
    ]);
    expect(getReidentifyPendingControlModels(models, 'sdxl')).toEqual([]);
    expect(getReidentifyPendingControlModels(models, null)).toEqual([]);
  });
});