const axios = require('axios'); async function fluxlora(prompt, { lora = 'icons' } = {}) { try { const loras = { 'icons': 'Flux-Icon-Kit-LoRA', 'logos': 'FLUX.1-dev-LoRA-Logo-Design', 'midjourney': 'Flux-Midjourney-Mix2-LoRA', 'tarot-card': 'flux-tarot-v1', 'vector-sketch': 'vector-illustration', 'colored-sketch': 'Flux-Sketch-Ep-LoRA', 'pencil-sketch': 'shou_xin', 'anime-sketch': 'anime-blockprint-style' }; if (!prompt) throw new Error('Prompt is required'); if (!loras[lora]) throw new Error(`Available loras: ${Object.keys(loras).join(', ')}`); const { data } = await axios.post('https://www.loras.dev/api/image', { prompt: prompt, lora: loras[lora], userAPIKey: '3b6743c93d84ccd6374f72a30c48c35619df27db1c04727d15d22d22c70aecb5', seed: Math.floor(Math.random() * 10000000) + 1 }, { headers: { 'content-type': 'application/json' } }); return data; } catch (error) { throw new Error(error.message); } } // Usage: const resp = await fluxlora('girl wearing glasses', { lora: 'midjourney' }); console.log(resp);