20 lines
577 B
TypeScript
20 lines
577 B
TypeScript
|
|
import { program } from 'commander';
|
||
|
|
import * as fs from 'fs/promises';
|
||
|
|
import { fetchProdia } from './prodia';
|
||
|
|
|
||
|
|
program
|
||
|
|
.name('prodia-scripts')
|
||
|
|
.description('cli for prodia usage')
|
||
|
|
.version('0.1.0');
|
||
|
|
|
||
|
|
program
|
||
|
|
.command('sdxl')
|
||
|
|
.description('generate an image with sdxl')
|
||
|
|
.argument('<config>', 'path to the config json')
|
||
|
|
.action(async (config) => {
|
||
|
|
const txt = await fs.readFile(config, { encoding: 'utf8' });
|
||
|
|
const json = JSON.parse(txt);
|
||
|
|
const status = await fetchProdia(json);
|
||
|
|
console.log('done:', status);
|
||
|
|
});
|