Spaces:
Running
Running
Update index.html
Browse files- index.html +213 -103
index.html
CHANGED
|
@@ -3,90 +3,154 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
-
<title>Apex Engine
|
| 7 |
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
|
| 9 |
<style>
|
| 10 |
-
@import url('https://fonts.googleapis.com/css2?family=
|
| 11 |
-
body { font-family: '
|
| 12 |
-
|
| 13 |
-
.
|
| 14 |
-
.
|
| 15 |
-
.
|
| 16 |
-
.
|
| 17 |
-
.btn-
|
|
|
|
|
|
|
| 18 |
</style>
|
| 19 |
</head>
|
| 20 |
-
<body class="p-4 md:p-
|
| 21 |
|
| 22 |
-
<div class="max-w-
|
| 23 |
-
<header class="
|
| 24 |
-
<
|
| 25 |
-
|
| 26 |
-
<p class="text-slate-500 text-sm">Analizador de seguridad y estructurador jerárquico</p>
|
| 27 |
-
</div>
|
| 28 |
-
<div id="safetyBadge" class="status-pill border px-4 py-2 rounded-full text-[10px] font-bold uppercase tracking-widest bg-slate-900/50">
|
| 29 |
-
Analizador: Esperando...
|
| 30 |
-
</div>
|
| 31 |
</header>
|
| 32 |
|
| 33 |
-
<div class="grid grid-cols-1 lg:grid-cols-
|
| 34 |
|
| 35 |
-
<div class="lg:col-span-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
<
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
|
|
|
| 49 |
</div>
|
| 50 |
</div>
|
| 51 |
-
<div class="bg-slate-900/
|
| 52 |
-
<
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
</div>
|
| 55 |
</div>
|
| 56 |
|
| 57 |
-
<div class="
|
| 58 |
-
<
|
| 59 |
-
<
|
| 60 |
-
<
|
| 61 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
</div>
|
|
|
|
| 63 |
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
</div>
|
| 69 |
|
| 70 |
-
<div class="lg:col-span-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
<
|
| 74 |
-
<
|
|
|
|
| 75 |
</div>
|
| 76 |
|
| 77 |
-
<div class="glass-
|
| 78 |
-
<h3 class="text-
|
| 79 |
-
<div id="outNeg" class="text-
|
| 80 |
-
<button onclick="copyText('outNeg')" class="mt-4 text-
|
| 81 |
</div>
|
| 82 |
|
| 83 |
-
<div class="glass-
|
| 84 |
-
<h3 class="text-
|
| 85 |
-
<div
|
| 86 |
-
<div
|
| 87 |
-
<div
|
| 88 |
-
<div
|
| 89 |
-
<div
|
| 90 |
</div>
|
| 91 |
</div>
|
| 92 |
</div>
|
|
@@ -95,84 +159,130 @@
|
|
| 95 |
|
| 96 |
<script>
|
| 97 |
let currentModel = 'flux';
|
|
|
|
|
|
|
|
|
|
| 98 |
const engines = {
|
| 99 |
-
flux: { sampler: 'FlowMatch', cfg: '3.5', steps: '28', sched: 'Simple', neg: 'low quality, blurry, text, watermark,
|
| 100 |
-
mj: { sampler: 'v6.0 Internal', cfg: '--stylize 250', steps: '50', sched: 'Karras', neg: '--no text, watermark, blurry, low resolution' },
|
| 101 |
-
sdxl: { sampler: 'DPM++ 2M SDE', cfg: '7.0', steps: '35', sched: 'Karras', neg: 'disfigured, extra limbs,
|
| 102 |
-
dalle: { sampler: 'Diffusion', cfg: 'Auto', steps: 'Auto', sched: 'Internal', neg: 'Avoid: watermarks, text, blurry artifacts,
|
| 103 |
};
|
| 104 |
|
| 105 |
-
const redFlags = ['blood', 'kill', '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
|
| 107 |
function analyzePrompt() {
|
| 108 |
const val = document.getElementById('rawPrompt').value.toLowerCase();
|
| 109 |
-
document.getElementById('charCount').innerText =
|
|
|
|
|
|
|
|
|
|
| 110 |
|
| 111 |
-
// 1. Análisis de Riesgo
|
| 112 |
let risks = redFlags.filter(word => val.includes(word));
|
| 113 |
-
const
|
| 114 |
-
const
|
| 115 |
|
| 116 |
if (risks.length > 0) {
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
} else {
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 126 |
}
|
| 127 |
-
|
| 128 |
-
// 2. Score de Estructura
|
| 129 |
-
let score = 0;
|
| 130 |
-
if (val.length > 20) score += 30;
|
| 131 |
-
if (val.length > 60) score += 40;
|
| 132 |
-
if (val.includes(',') || val.includes('.')) score += 30;
|
| 133 |
-
|
| 134 |
-
document.getElementById('scoreFill').style.width = `${score}%`;
|
| 135 |
-
document.getElementById('scoreFill').className = `h-full transition-all ${score > 70 ? 'bg-green-500' : 'bg-yellow-500'}`;
|
| 136 |
}
|
| 137 |
|
| 138 |
function updateModel(m) {
|
| 139 |
currentModel = m;
|
| 140 |
-
document.querySelectorAll('.
|
| 141 |
-
document.getElementById(`m-${m}`).classList.add('
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 142 |
}
|
| 143 |
|
| 144 |
function generateApex() {
|
| 145 |
-
const raw = document.getElementById('rawPrompt').value;
|
| 146 |
-
if(!raw)
|
|
|
|
|
|
|
|
|
|
| 147 |
|
| 148 |
const config = engines[currentModel];
|
|
|
|
|
|
|
|
|
|
| 149 |
let pos = "";
|
|
|
|
|
|
|
| 150 |
|
| 151 |
-
// Re-estructuración Jerárquica
|
| 152 |
-
if(currentModel === 'mj') {
|
| 153 |
-
pos = `${raw},
|
| 154 |
} else if (currentModel === 'flux') {
|
| 155 |
-
pos = `[Subject: ${raw}] [
|
| 156 |
} else if (currentModel === 'dalle') {
|
| 157 |
-
pos = `A professional
|
| 158 |
-
} else {
|
| 159 |
-
pos = `(masterpiece), (best quality), ${raw},
|
| 160 |
}
|
| 161 |
|
| 162 |
document.getElementById('outPos').innerText = pos;
|
| 163 |
document.getElementById('outNeg').innerText = config.neg;
|
| 164 |
-
|
| 165 |
-
|
|
|
|
|
|
|
|
|
|
| 166 |
document.getElementById('s-samp').innerText = config.sampler;
|
| 167 |
-
document.getElementById('s-step').innerText = config.steps;
|
| 168 |
document.getElementById('s-cfg').innerText = config.cfg;
|
|
|
|
| 169 |
document.getElementById('s-sched').innerText = config.sched;
|
| 170 |
}
|
| 171 |
|
| 172 |
function copyText(id) {
|
| 173 |
navigator.clipboard.writeText(document.getElementById(id).innerText);
|
| 174 |
-
alert("Copiado!");
|
| 175 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 176 |
</script>
|
| 177 |
</body>
|
| 178 |
</html>
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Apex Engine v7 - Aether Forge</title>
|
| 7 |
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
|
| 9 |
<style>
|
| 10 |
+
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Roboto:wght@300;400;700&display=swap');
|
| 11 |
+
body { font-family: 'Roboto', sans-serif; background-color: #030712; color: #f9fafb; }
|
| 12 |
+
h1, h2, h3 { font-family: 'Orbitron', sans-serif; }
|
| 13 |
+
.glass-card { background: rgba(17, 24, 39, 0.7); backdrop-filter: blur(15px); border: 1px solid rgba(255, 255, 255, 0.08); }
|
| 14 |
+
.input-glow:focus { border-color: #8b5cf6; box-shadow: 0 0 15px rgba(139, 92, 246, 0.4); }
|
| 15 |
+
.model-btn.active { background-color: #8b5cf6; border-color: #c084fc; box-shadow: 0 0 10px rgba(139, 92, 246, 0.5); color: white; }
|
| 16 |
+
.style-btn.active { background-color: #a855f7; border-color: #c084fc; }
|
| 17 |
+
.btn-forge { background: linear-gradient(135deg, #8b5cf6 0%, #c084fc 100%); transition: all 0.3s ease; }
|
| 18 |
+
.btn-forge:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(139, 92, 246, 0.4); }
|
| 19 |
+
.status-badge { transition: all 0.4s ease; }
|
| 20 |
</style>
|
| 21 |
</head>
|
| 22 |
+
<body class="p-4 md:p-10">
|
| 23 |
|
| 24 |
+
<div class="max-w-8xl mx-auto">
|
| 25 |
+
<header class="text-center mb-12">
|
| 26 |
+
<h1 class="text-5xl font-black mb-2 text-transparent bg-clip-text bg-gradient-to-r from-purple-400 to-fuchsia-600">AETHER FORGE <span class="text-xl text-slate-500 font-normal">v7.0</span></h1>
|
| 27 |
+
<p class="text-slate-400 font-light text-lg">Ingeniería de prompts cuántica para resultados sin precedentes.</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
</header>
|
| 29 |
|
| 30 |
+
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
|
| 31 |
|
| 32 |
+
<div class="lg:col-span-2 space-y-8">
|
| 33 |
+
|
| 34 |
+
<div class="glass-card p-8 rounded-3xl shadow-xl">
|
| 35 |
+
<h2 class="text-2xl font-bold mb-6 text-purple-400">1. Idea y Análisis</h2>
|
| 36 |
+
<label class="block text-sm font-light text-slate-400 mb-2">Tu Concepto Base (sé creativo, nosotros lo estructuramos)</label>
|
| 37 |
+
<textarea id="rawPrompt" oninput="analyzePrompt()" rows="6" class="w-full bg-slate-900 border border-slate-700 rounded-xl p-4 text-white placeholder-slate-600 outline-none input-glow transition mb-4" placeholder="Ej: Un dragón de cristal en una cueva submarina, estilo anime, luces suaves..."></textarea>
|
| 38 |
+
|
| 39 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
| 40 |
+
<div class="bg-slate-900/50 p-4 rounded-xl border border-slate-800 flex justify-between items-center">
|
| 41 |
+
<div>
|
| 42 |
+
<span class="text-xs text-slate-500 uppercase block">Caracteres</span>
|
| 43 |
+
<span id="charCount" class="text-lg font-bold">0</span>
|
| 44 |
+
</div>
|
| 45 |
+
<div class="w-2/3 h-2 bg-slate-700 rounded-full overflow-hidden">
|
| 46 |
+
<div id="promptLengthBar" class="h-full bg-fuchsia-500 transition-all" style="width:0%;"></div>
|
| 47 |
</div>
|
| 48 |
</div>
|
| 49 |
+
<div class="bg-slate-900/50 p-4 rounded-xl border border-slate-800 flex justify-between items-center">
|
| 50 |
+
<div>
|
| 51 |
+
<span class="text-xs text-slate-500 uppercase block">Riesgo de Bloqueo</span>
|
| 52 |
+
<span id="riskLevel" class="text-lg font-bold text-green-400">BAJO</span>
|
| 53 |
+
</div>
|
| 54 |
+
<div id="safetyBadge" class="text-xs font-bold status-badge py-1 px-3 rounded-full bg-green-900/30 text-green-400">SEGURO</div>
|
| 55 |
+
</div>
|
| 56 |
+
</div>
|
| 57 |
+
</div>
|
| 58 |
+
|
| 59 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
|
| 60 |
+
<div class="glass-card p-8 rounded-3xl shadow-xl">
|
| 61 |
+
<h3 class="text-xl font-bold mb-4 text-fuchsia-400">2. Motor de IA</h3>
|
| 62 |
+
<label class="block text-sm font-light text-slate-400 mb-3">Selecciona tu modelo preferido:</label>
|
| 63 |
+
<div class="grid grid-cols-2 gap-3">
|
| 64 |
+
<button onclick="updateModel('flux')" id="m-flux" class="model-btn p-3 rounded-xl border border-slate-700 text-xs font-bold active">FLUX.1</button>
|
| 65 |
+
<button onclick="updateModel('mj')" id="m-mj" class="model-btn p-3 rounded-xl border border-slate-700 text-xs font-bold">MIDJOURNEY</button>
|
| 66 |
+
<button onclick="updateModel('sdxl')" id="m-sdxl" class="model-btn p-3 rounded-xl border border-slate-700 text-xs font-bold">SDXL 1.0</button>
|
| 67 |
+
<button onclick="updateModel('dalle')" id="m-dalle" class="model-btn p-3 rounded-xl border border-slate-700 text-xs font-bold">DALL-E 3</button>
|
| 68 |
</div>
|
| 69 |
</div>
|
| 70 |
|
| 71 |
+
<div class="glass-card p-8 rounded-3xl shadow-xl">
|
| 72 |
+
<h3 class="text-xl font-bold mb-4 text-fuchsia-400">3. Estilo Rápido</h3>
|
| 73 |
+
<label class="block text-sm font-light text-slate-400 mb-3">Inyecta un estilo con un clic:</label>
|
| 74 |
+
<div class="grid grid-cols-2 gap-3">
|
| 75 |
+
<button onclick="applyStyle('photorealistic')" class="style-btn p-3 rounded-xl border border-slate-700 text-xs font-bold">FOTOREALISTA</button>
|
| 76 |
+
<button onclick="applyStyle('cinematic')" class="style-btn p-3 rounded-xl border border-slate-700 text-xs font-bold">CINEMÁTICO</button>
|
| 77 |
+
<button onclick="applyStyle('anime')" class="style-btn p-3 rounded-xl border border-slate-700 text-xs font-bold">ANIME</button>
|
| 78 |
+
<button onclick="applyStyle('oil painting')" class="style-btn p-3 rounded-xl border border-slate-700 text-xs font-bold">PINTURA AL ÓLEO</button>
|
| 79 |
+
</div>
|
| 80 |
</div>
|
| 81 |
+
</div>
|
| 82 |
|
| 83 |
+
<div class="glass-card p-8 rounded-3xl shadow-xl">
|
| 84 |
+
<h3 class="text-xl font-bold mb-4 text-fuchsia-400">4. Ajustes Finos (Iluminación & Cámara)</h3>
|
| 85 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
| 86 |
+
<div>
|
| 87 |
+
<label class="block text-sm font-light text-slate-400 mb-2">Tipo de Luz</label>
|
| 88 |
+
<select id="lightType" onchange="updateLightPrompt()" class="w-full bg-slate-800 border border-slate-700 rounded-xl p-3 text-sm outline-none input-glow transition">
|
| 89 |
+
<option value="">Automática</option>
|
| 90 |
+
<option value="natural">Natural</option>
|
| 91 |
+
<option value="artificial">Artificial</option>
|
| 92 |
+
<option value="magical">Mágica/Fantástica</option>
|
| 93 |
+
</select>
|
| 94 |
+
</div>
|
| 95 |
+
<div>
|
| 96 |
+
<label class="block text-sm font-light text-slate-400 mb-2">Dirección de Luz</label>
|
| 97 |
+
<select id="lightDirection" onchange="updateLightPrompt()" class="w-full bg-slate-800 border border-slate-700 rounded-xl p-3 text-sm outline-none input-glow transition">
|
| 98 |
+
<option value="">Estándar</option>
|
| 99 |
+
<option value="front-lit">Frontal</option>
|
| 100 |
+
<option value="backlight">Contraluz</option>
|
| 101 |
+
<option value="side-lit">Lateral</option>
|
| 102 |
+
<option value="top-down">Cenital</option>
|
| 103 |
+
</select>
|
| 104 |
+
</div>
|
| 105 |
+
<div>
|
| 106 |
+
<label class="block text-sm font-light text-slate-400 mb-2">Tipo de Cámara</label>
|
| 107 |
+
<select id="cameraType" class="w-full bg-slate-800 border border-slate-700 rounded-xl p-3 text-sm outline-none input-glow transition">
|
| 108 |
+
<option value="professional shot">Cámara profesional</option>
|
| 109 |
+
<option value="shot on Fujifilm XT4">Fujifilm XT4</option>
|
| 110 |
+
<option value="shot on Sony A7III">Sony A7III</option>
|
| 111 |
+
<option value="shot on iPhone 15 Pro">iPhone 15 Pro</option>
|
| 112 |
+
<option value="GoPro point of view">GoPro POV</option>
|
| 113 |
+
</select>
|
| 114 |
+
</div>
|
| 115 |
+
<div>
|
| 116 |
+
<label class="block text-sm font-light text-slate-400 mb-2">Relación de Aspecto</label>
|
| 117 |
+
<select id="ar" class="w-full bg-slate-800 border border-slate-700 rounded-xl p-3 text-sm outline-none input-glow transition">
|
| 118 |
+
<option value="16:9">16:9 (Cinemático)</option>
|
| 119 |
+
<option value="1:1">1:1 (Cuadrado)</option>
|
| 120 |
+
<option value="9:16">9:16 (Vertical)</option>
|
| 121 |
+
<option value="21:9">21:9 (Ultra Wide)</option>
|
| 122 |
+
</select>
|
| 123 |
+
</div>
|
| 124 |
+
</div>
|
| 125 |
</div>
|
| 126 |
+
|
| 127 |
+
<button onclick="generateApex()" class="btn-forge w-full py-5 rounded-2xl text-white font-black text-xl uppercase tracking-wider shadow-2xl">
|
| 128 |
+
<i class="fa-solid fa-fire text-white mr-3"></i> FORJAR PROMPT APEX
|
| 129 |
+
</button>
|
| 130 |
+
|
| 131 |
</div>
|
| 132 |
|
| 133 |
+
<div class="lg:col-span-1 space-y-8">
|
| 134 |
+
|
| 135 |
+
<div class="glass-card p-6 rounded-3xl border-l-4 border-purple-500 shadow-lg">
|
| 136 |
+
<h3 class="text-lg font-bold text-purple-400 mb-4">Prompt Estructurado</h3>
|
| 137 |
+
<div id="outPos" class="text-sm text-slate-300 min-h-[120px] leading-relaxed italic font-light">Tu prompt optimizado aparecerá aquí.</div>
|
| 138 |
+
<button onclick="copyText('outPos')" class="mt-4 text-xs font-bold text-slate-500 hover:text-white uppercase tracking-wider"><i class="fa-regular fa-copy mr-1"></i> Copiar</button>
|
| 139 |
</div>
|
| 140 |
|
| 141 |
+
<div class="glass-card p-6 rounded-3xl border-l-4 border-red-500 shadow-lg">
|
| 142 |
+
<h3 class="text-lg font-bold text-red-400 mb-4">Prompt Negativo (Anti-Error)</h3>
|
| 143 |
+
<div id="outNeg" class="text-xs text-red-200/50 min-h-[80px]">Aquí se listarán las exclusiones automáticas.</div>
|
| 144 |
+
<button onclick="copyText('outNeg')" class="mt-4 text-xs font-bold text-slate-500 hover:text-white uppercase tracking-wider"><i class="fa-regular fa-copy mr-1"></i> Copiar</button>
|
| 145 |
</div>
|
| 146 |
|
| 147 |
+
<div class="glass-card p-6 rounded-3xl bg-indigo-950/20 shadow-lg">
|
| 148 |
+
<h3 class="text-lg font-bold text-emerald-400 mb-4">Configuración Técnica</h3>
|
| 149 |
+
<div class="grid grid-cols-2 gap-y-3 text-sm">
|
| 150 |
+
<div class="text-slate-500">Sampler:</div><div id="s-samp" class="font-bold">N/A</div>
|
| 151 |
+
<div class="text-slate-500">CFG Scale:</div><div id="s-cfg" class="font-bold">N/A</div>
|
| 152 |
+
<div class="text-slate-500">Steps:</div><div id="s-step" class="font-bold">N/A</div>
|
| 153 |
+
<div class="text-slate-500">Scheduler:</div><div id="s-sched" class="font-bold">N/A</div>
|
| 154 |
</div>
|
| 155 |
</div>
|
| 156 |
</div>
|
|
|
|
| 159 |
|
| 160 |
<script>
|
| 161 |
let currentModel = 'flux';
|
| 162 |
+
let currentStyle = ''; // Almacena el estilo seleccionado
|
| 163 |
+
let lightPrompt = ''; // Almacena el prompt de iluminación
|
| 164 |
+
|
| 165 |
const engines = {
|
| 166 |
+
flux: { sampler: 'FlowMatch', cfg: '3.5', steps: '28', sched: 'Simple', neg: 'low quality, blurry, distorted text, messy fingers, watermark, low resolution, ugly, oversaturated, deformed' },
|
| 167 |
+
mj: { sampler: 'v6.0 Internal', cfg: '--stylize 250', steps: '50', sched: 'Karras', neg: '--no text, watermark, blurry, low resolution, distorted limbs, extra elements' },
|
| 168 |
+
sdxl: { sampler: 'DPM++ 2M SDE', cfg: '7.0', steps: '35', sched: 'Karras', neg: 'deformed, bad anatomy, disfigured, poorly drawn face, mutated, extra limbs, low quality, blurred, grain, text, watermark' },
|
| 169 |
+
dalle: { sampler: 'Diffusion', cfg: 'Auto', steps: 'Auto', sched: 'Internal', neg: 'Avoid: watermarks, low resolution, text, blurry artifacts, duplicate images' }
|
| 170 |
};
|
| 171 |
|
| 172 |
+
const redFlags = ['blood', 'kill', 'gore', 'naked', 'explicit', 'violence', 'weapon', 'drug', 'suicide', 'political leader', 'hate speech'];
|
| 173 |
+
|
| 174 |
+
const styles = {
|
| 175 |
+
photorealistic: 'hyperrealistic, photorealistic, 8k, ultra-detailed, sharp focus, RAW photo',
|
| 176 |
+
cinematic: 'cinematic still, film grain, dramatic lighting, anamorphic lens, epic composition',
|
| 177 |
+
anime: 'anime style, vibrant colors, Studio Ghibli inspired, detailed line art, cell shaded',
|
| 178 |
+
'oil painting': 'oil painting, textured brushstrokes, classical art, masterpiece, heavy impasto'
|
| 179 |
+
};
|
| 180 |
|
| 181 |
function analyzePrompt() {
|
| 182 |
const val = document.getElementById('rawPrompt').value.toLowerCase();
|
| 183 |
+
document.getElementById('charCount').innerText = val.length;
|
| 184 |
+
|
| 185 |
+
const lengthPercentage = Math.min(100, (val.length / 100) * 100); // 100 chars = 100%
|
| 186 |
+
document.getElementById('promptLengthBar').style.width = `${lengthPercentage}%`;
|
| 187 |
|
|
|
|
| 188 |
let risks = redFlags.filter(word => val.includes(word));
|
| 189 |
+
const riskLevelEl = document.getElementById('riskLevel');
|
| 190 |
+
const safetyBadgeEl = document.getElementById('safetyBadge');
|
| 191 |
|
| 192 |
if (risks.length > 0) {
|
| 193 |
+
riskLevelEl.innerText = `ALTO (${risks[0]})`;
|
| 194 |
+
riskLevelEl.className = 'text-lg font-bold text-red-400';
|
| 195 |
+
safetyBadgeEl.innerText = "RIESGO DE BLOQUEO";
|
| 196 |
+
safetyBadgeEl.className = "text-xs font-bold status-badge py-1 px-3 rounded-full bg-red-900/30 text-red-400";
|
| 197 |
+
} else if (val.length > 0 && val.length < 30) {
|
| 198 |
+
riskLevelEl.innerText = 'MEDIO (Vago)';
|
| 199 |
+
riskLevelEl.className = 'text-lg font-bold text-yellow-400';
|
| 200 |
+
safetyBadgeEl.innerText = "PROMPT GENÉRICO";
|
| 201 |
+
safetyBadgeEl.className = "text-xs font-bold status-badge py-1 px-3 rounded-full bg-yellow-900/30 text-yellow-400";
|
| 202 |
+
}
|
| 203 |
+
else {
|
| 204 |
+
riskLevelEl.innerText = 'BAJO';
|
| 205 |
+
riskLevelEl.className = 'text-lg font-bold text-green-400';
|
| 206 |
+
safetyBadgeEl.innerText = "PROMPT SEGURO";
|
| 207 |
+
safetyBadgeEl.className = "text-xs font-bold status-badge py-1 px-3 rounded-full bg-green-900/30 text-green-400";
|
| 208 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 209 |
}
|
| 210 |
|
| 211 |
function updateModel(m) {
|
| 212 |
currentModel = m;
|
| 213 |
+
document.querySelectorAll('.model-btn').forEach(b => b.classList.remove('active'));
|
| 214 |
+
document.getElementById(`m-${m}`).classList.add('active');
|
| 215 |
+
updateTechSpecs(); // Actualiza los parámetros técnicos al cambiar de modelo
|
| 216 |
+
}
|
| 217 |
+
|
| 218 |
+
function applyStyle(styleKey) {
|
| 219 |
+
currentStyle = styleKey;
|
| 220 |
+
document.querySelectorAll('.style-btn').forEach(b => b.classList.remove('active'));
|
| 221 |
+
event.target.classList.add('active');
|
| 222 |
+
}
|
| 223 |
+
|
| 224 |
+
function updateLightPrompt() {
|
| 225 |
+
const lightType = document.getElementById('lightType').value;
|
| 226 |
+
const lightDirection = document.getElementById('lightDirection').value;
|
| 227 |
+
|
| 228 |
+
let parts = [];
|
| 229 |
+
if (lightType) {
|
| 230 |
+
parts.push(lightType === 'magical' ? 'magical glowing light' : `${lightType} light`);
|
| 231 |
+
}
|
| 232 |
+
if (lightDirection) {
|
| 233 |
+
parts.push(lightDirection);
|
| 234 |
+
}
|
| 235 |
+
lightPrompt = parts.length > 0 ? parts.join(' ') + ' illumination' : '';
|
| 236 |
}
|
| 237 |
|
| 238 |
function generateApex() {
|
| 239 |
+
const raw = document.getElementById('rawPrompt').value.trim();
|
| 240 |
+
if (!raw) {
|
| 241 |
+
alert("Por favor, ingresa tu idea principal en el campo de texto.");
|
| 242 |
+
return;
|
| 243 |
+
}
|
| 244 |
|
| 245 |
const config = engines[currentModel];
|
| 246 |
+
const camera = document.getElementById('cameraType').value;
|
| 247 |
+
const ar = document.getElementById('ar').value;
|
| 248 |
+
|
| 249 |
let pos = "";
|
| 250 |
+
let styleText = currentStyle ? styles[currentStyle] : '';
|
| 251 |
+
let finalLight = lightPrompt ? lightPrompt : 'cinematic lighting'; // Default lighting
|
| 252 |
|
| 253 |
+
// Lógica de Re-estructuración Jerárquica
|
| 254 |
+
if (currentModel === 'mj') {
|
| 255 |
+
pos = `${raw}, ${styleText ? styleText + ', ' : ''}${finalLight}, ${camera} --ar ${ar} --v 6.0 --q 2`;
|
| 256 |
} else if (currentModel === 'flux') {
|
| 257 |
+
pos = `[Subject: ${raw}] [Aesthetic: ${styleText ? styleText : 'ultra-detailed, sharp focus'}] [Light: ${finalLight}] [Camera: ${camera}] --ar ${ar}`;
|
| 258 |
} else if (currentModel === 'dalle') {
|
| 259 |
+
pos = `A professional, highly detailed, ${styleText ? styleText + ' image, ' : ''} of: ${raw}. Featuring ${finalLight} and captured with a ${camera} perspective. Aspect Ratio: ${ar}.`;
|
| 260 |
+
} else { // SDXL
|
| 261 |
+
pos = `(masterpiece:1.3), (best quality), ${raw}, ${styleText ? styleText + ', ' : ''}${finalLight}, ${camera}, 8k, UHD, intricate details`;
|
| 262 |
}
|
| 263 |
|
| 264 |
document.getElementById('outPos').innerText = pos;
|
| 265 |
document.getElementById('outNeg').innerText = config.neg;
|
| 266 |
+
updateTechSpecs(); // Asegura que los tech specs se actualicen con el prompt
|
| 267 |
+
}
|
| 268 |
+
|
| 269 |
+
function updateTechSpecs() {
|
| 270 |
+
const config = engines[currentModel];
|
| 271 |
document.getElementById('s-samp').innerText = config.sampler;
|
|
|
|
| 272 |
document.getElementById('s-cfg').innerText = config.cfg;
|
| 273 |
+
document.getElementById('s-step').innerText = config.steps;
|
| 274 |
document.getElementById('s-sched').innerText = config.sched;
|
| 275 |
}
|
| 276 |
|
| 277 |
function copyText(id) {
|
| 278 |
navigator.clipboard.writeText(document.getElementById(id).innerText);
|
| 279 |
+
alert("¡Copiado al portapapeles!");
|
| 280 |
}
|
| 281 |
+
|
| 282 |
+
// Inicialización
|
| 283 |
+
updateModel('flux'); // Set default model
|
| 284 |
+
updateLightPrompt(); // Initialize light prompt
|
| 285 |
+
analyzePrompt(); // Initial analysis
|
| 286 |
</script>
|
| 287 |
</body>
|
| 288 |
</html>
|