Chips and quick patches apply params without auto-Generate; aspect sizes match Swarm Side Length 1024. HF import shows drafts after switching filter from approved-only; training status and job polling improved. Co-authored-by: Cursor <cursoragent@cursor.com>
32 lines
1.1 KiB
JavaScript
32 lines
1.1 KiB
JavaScript
import assert from 'node:assert/strict';
|
|
import { describe, it } from 'node:test';
|
|
import {
|
|
DEFAULT_ASPECT_TABLE,
|
|
buildDefaultAspectTable,
|
|
swarmSizeFromRef,
|
|
} from '../src/aspect.js';
|
|
|
|
describe('aspect.js (SwarmUI side 1024)', () => {
|
|
it('16:9 and 9:16 match Swarm Resolution dropdown', () => {
|
|
assert.deepEqual(swarmSizeFromRef('16:9'), [1344, 768]);
|
|
assert.deepEqual(swarmSizeFromRef('9:16'), [768, 1344]);
|
|
});
|
|
|
|
it('default table uses Swarm formula for landscape/portrait chips', () => {
|
|
assert.deepEqual(DEFAULT_ASPECT_TABLE['16:9'], [1344, 768]);
|
|
assert.deepEqual(DEFAULT_ASPECT_TABLE['9:16'], [768, 1344]);
|
|
assert.deepEqual(DEFAULT_ASPECT_TABLE['2:3'], [832, 1216]);
|
|
assert.deepEqual(DEFAULT_ASPECT_TABLE['1:1'], [1024, 1024]);
|
|
});
|
|
|
|
it('2.35:1 aliases 21:9', () => {
|
|
assert.deepEqual(DEFAULT_ASPECT_TABLE['2.35:1'], DEFAULT_ASPECT_TABLE['21:9']);
|
|
assert.deepEqual(DEFAULT_ASPECT_TABLE['21:9'], [1536, 640]);
|
|
});
|
|
|
|
it('scales with side length', () => {
|
|
const t = buildDefaultAspectTable(512);
|
|
assert.deepEqual(t['16:9'], [672, 384]);
|
|
});
|
|
});
|