Spaces:
Running
on
Zero
Running
on
Zero
""" | |
Ultra Supreme Analyzer - VERSIÓN SIMPLIFICADA | |
Solo formatea, no limita | |
""" | |
import re | |
from typing import Dict, List, Any, Tuple | |
class UltraSupremeAnalyzer: | |
"""Analyzer simplificado que NO limita CLIP""" | |
def __init__(self): | |
pass | |
def ultra_supreme_analysis(self, clip_fast: str, clip_classic: str, clip_best: str) -> Dict[str, Any]: | |
"""Análisis mínimo - solo devuelve los datos raw""" | |
return { | |
"clip_fast": clip_fast, | |
"clip_classic": clip_classic, | |
"clip_best": clip_best, | |
"full_description": f"{clip_fast} {clip_classic} {clip_best}" | |
} | |
def build_ultra_supreme_prompt(self, ultra_analysis: Dict[str, Any], clip_results: List[str]) -> str: | |
"""NO construye nada - este método ya no se usa con el nuevo pipeline""" | |
# Este método existe solo por compatibilidad | |
# El verdadero trabajo se hace en optimizer.py con apply_flux_rules() | |
return clip_results[0] if clip_results else "" | |
def calculate_ultra_supreme_score(self, prompt: str, ultra_analysis: Dict[str, Any]) -> Tuple[int, Dict[str, int]]: | |
"""Calcula score basado en la longitud y riqueza del prompt""" | |
score = 0 | |
breakdown = {} | |
# Simple scoring basado en características del prompt final | |
if len(prompt) > 50: | |
score += 25 | |
breakdown["length"] = 25 | |
if "Shot on" in prompt: | |
score += 25 | |
breakdown["camera"] = 25 | |
if "lighting" in prompt.lower(): | |
score += 25 | |
breakdown["lighting"] = 25 | |
if any(word in prompt.lower() for word in ["photography", "cinematic", "professional"]): | |
score += 25 | |
breakdown["style"] = 25 | |
return min(score, 100), breakdown |