mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
- Only export when necessary - Remove totally usused functions, variables, state, etc - Remove unused packages
19 lines
489 B
TypeScript
19 lines
489 B
TypeScript
import { NUMPY_RAND_MAX, NUMPY_RAND_MIN } from 'app/constants';
|
|
import { random } from 'lodash-es';
|
|
|
|
export type GenerateSeedsArg = {
|
|
count: number;
|
|
start?: number;
|
|
min?: number;
|
|
max?: number;
|
|
};
|
|
|
|
export const generateSeeds = ({ count, start, min = NUMPY_RAND_MIN, max = NUMPY_RAND_MAX }: GenerateSeedsArg) => {
|
|
const first = start ?? random(min, max);
|
|
const seeds: number[] = [];
|
|
for (let i = first; i < first + count; i++) {
|
|
seeds.push(i % max);
|
|
}
|
|
return seeds;
|
|
};
|