Unrestricted Open-source alternative to AI video platforms — Free AI image & video generation studio with 600+ models (Flux, Midjourney, Kling, Sora, Veo). No content filters. Self-hosted, MIT licensed.
JavaScript ai-art-generatorai-image-generationai-video-generationfal-ai-alternativegenerative-aiimage-to-videoinvideo-alternativekling-ailipsynclitellm-alternativemidjourney-alternativemuapiopen-sourceopenrouter-alternativeseedance2sora-alternativetext-to-imagetext-to-videouncensoredwan-video
const path = require('path');
const LOCAL_AI_DIR_ENV = 'OPEN_GENERATIVE_AI_LOCAL_AI_DIR';
function normalizeDirOverride(value) {
return typeof value === 'string' ? value.trim() : '';
}
function resolveLocalAiPaths({ userDataPath, env = process.env } = {}) {
const customDir = normalizeDirOverride(env[LOCAL_AI_DIR_ENV]);
if (!customDir && !userDataPath) {
throw new Error(`userDataPath is required when ${LOCAL_AI_DIR_ENV} is not set`);
}
const dataDir = path.resolve(customDir || path.join(userDataPath, 'local-ai'));
return {
dataDir,
binDir: path.join(dataDir, 'bin'),
modelsDir: path.join(dataDir, 'models'),
tmpDir: path.join(dataDir, 'tmp'),
};
}
module.exports = {
LOCAL_AI_DIR_ENV,
resolveLocalAiPaths,
};