ivanoctaviogaitansantos's picture
Update app.py
5b3f72b verified
import gradio as gr
import random
import json
# === Base de datos de personajes en Python (más mantenible que JS) ===
characters = [
{"name": "Lion-O", "universe": "ThunderCats", "species": "Feline-humanoid", "attack": "Sword of Omens – \"Ho!\""},
{"name": "Tygra", "universe": "ThunderCats", "species": "Feline-humanoid", "attack": "Feline Mirage"},
{"name": "Cheetara", "universe": "ThunderCats", "species": "Feline-humanoid", "attack": "Supersonic Boomerang"},
{"name": "Panthro", "universe": "ThunderCats", "species": "Feline-humanoid", "attack": "Electrified Nunchaku"},
{"name": "Jaga", "universe": "ThunderCats", "species": "Feline-humanoid", "attack": "Ancient Wisdom"},
{"name": "WilyKat", "universe": "ThunderCats", "species": "Feline-humanoid", "attack": "Traps and Smoke Bombs"},
{"name": "WilyKit", "universe": "ThunderCats", "species": "Feline-humanoid", "attack": "Explosive Capsules"},
{"name": "Snarf", "universe": "ThunderCats", "species": "Creature", "attack": "Defense and Support"},
{"name": "Pumara", "universe": "ThunderCats", "species": "Ally", "attack": "Sling and Articulated Crossbow"},
{"name": "Snowmeow", "universe": "ThunderCats", "species": "Ally", "attack": "Charge and Feline Agility"},
{"name": "Mumm-Ra", "universe": "ThunderCats", "species": "Villain", "attack": "Transformation into Mumm-Ra the Ever-Living"},
{"name": "Grune the Destroyer", "universe": "ThunderCats", "species": "Villain", "attack": "Grune's Mace"},
{"name": "Jackalman", "universe": "ThunderCats", "species": "Mutant", "attack": "Weapons and Technology"},
{"name": "Slythe", "universe": "ThunderCats", "species": "Mutant", "attack": "Acid Lance"},
{"name": "Vultureman", "universe": "ThunderCats", "species": "Mutant", "attack": "Plasma Rifle"},
{"name": "Monkian", "universe": "ThunderCats", "species": "Mutant", "attack": "Claws and Brute Force"},
{"name": "Sailor Moon (Usagi Tsukino)", "universe": "Sailor Moon", "species": "Human (cosplay)", "attack": "Moon Tiara Action"},
{"name": "Sailor Mercury (Ami Mizuno)", "universe": "Sailor Moon", "species": "Human (cosplay)", "attack": "Mercury Aqua Mist"},
{"name": "Sailor Mars (Rei Hino)", "universe": "Sailor Moon", "species": "Human (cosplay)", "attack": "Fire Soul"},
{"name": "Sailor Jupiter (Makoto Kino)", "universe": "Sailor Moon", "species": "Human (cosplay)", "attack": "Supreme Thunder"},
{"name": "Sailor Venus (Minako Aino)", "universe": "Sailor Moon", "species": "Human (cosplay)", "attack": "Venus Love-Me Chain"},
{"name": "Sailor Chibi Moon (Chibiusa)", "universe": "Sailor Moon", "species": "Human (cosplay)", "attack": "Pink Sugar Heart Attack"},
{"name": "Sailor Uranus (Haruka Ten'ou)", "universe": "Sailor Moon", "species": "Human (cosplay)", "attack": "World Shaking"},
{"name": "Sailor Neptune (Michiru Kaio)", "universe": "Sailor Moon", "species": "Human (cosplay)", "attack": "Deep Submerge"},
{"name": "Sailor Pluto (Setsuna Meio)", "universe": "Sailor Moon", "species": "Human (cosplay)", "attack": "Dead Scream"},
{"name": "Sailor Saturn (Hotaru Tomoe)", "universe": "Sailor Moon", "species": "Human (cosplay)", "attack": "Silence Glaive"},
{"name": "Tuxedo Mask (Mamoru Chiba)", "universe": "Sailor Moon", "species": "Ally", "attack": "Rose Throw and Healing Powers"},
{"name": "Queen Beryl", "universe": "Sailor Moon", "species": "Villain", "attack": "Dark Magic"},
{"name": "Queen Metalia", "universe": "Sailor Moon", "species": "Villain", "attack": "Dark Energy Control"},
{"name": "Kunzite", "universe": "Sailor Moon", "species": "Villain", "attack": "Element Manipulation"},
{"name": "Zoisite", "universe": "Sailor Moon", "species": "Villain", "attack": "Element Manipulation"},
{"name": "Nephrite", "universe": "Sailor Moon", "species": "Villain", "attack": "Element Manipulation"},
{"name": "Jadeite", "universe": "Sailor Moon", "species": "Villain", "attack": "Element Manipulation"},
{"name": "Wiseman", "universe": "Sailor Moon", "species": "Villain", "attack": "Time Manipulation"},
{"name": "Black Lady (Corrupted Chibiusa)", "universe": "Sailor Moon", "species": "Villain", "attack": "Attacks with the Black Crystal"},
{"name": "Pharaoh 90", "universe": "Sailor Moon", "species": "Villain", "attack": "Planetary Energy Absorption"},
{"name": "Queen Nehelenia", "universe": "Sailor Moon", "species": "Villain", "attack": "Illusions and Mirror Manipulation"},
{"name": "Ryu", "universe": "Street Fighter", "species": "Human (cosplay)", "attack": "Hadouken"},
{"name": "Ken", "universe": "Street Fighter", "species": "Human (cosplay)", "attack": "Shoryuken"},
{"name": "Chun-Li", "universe": "Street Fighter", "species": "Human (cosplay)", "attack": "Lightning Kicks"},
{"name": "Guile", "universe": "Street Fighter", "species": "Human (cosplay)", "attack": "Sonic Boom"},
{"name": "Blanka", "universe": "Street Fighter", "species": "Mutant Creature", "attack": "Electric Thunder"},
{"name": "Dhalsim", "universe": "Street Fighter", "species": "Human (cosplay)", "attack": "Yoga Fire"},
{"name": "E. Honda", "universe": "Street Fighter", "species": "Human (cosplay)", "attack": "Hundred Hand Slap"},
{"name": "Zangief", "universe": "Street Fighter", "species": "Human (cosplay)", "attack": "Spinning Piledriver"},
{"name": "Cammy", "universe": "Street Fighter", "species": "Human (cosplay)", "attack": "Cannon Spike"},
{"name": "Sagat", "universe": "Street Fighter", "species": "Human (cosplay)", "attack": "Tiger Shot"},
{"name": "Vega", "universe": "Street Fighter", "species": "Feline Mutant", "attack": "Flying Barcelona Attack"},
{"name": "Balrog", "universe": "Street Fighter", "species": "Human (cosplay)", "attack": "Gigaton Blow"},
{"name": "M. Bison", "universe": "Street Fighter", "species": "Human (cosplay)", "attack": "Psycho Crusher"},
{"name": "Akuma", "universe": "Street Fighter", "species": "Demon", "attack": "Raging Demon"},
{"name": "Sakura", "universe": "Street Fighter", "species": "Human (cosplay)", "attack": "Shouoken"},
{"name": "Rose", "universe": "Street Fighter", "species": "Human (cosplay)", "attack": "Soul Spark"},
{"name": "Cody", "universe": "Street Fighter", "species": "Human (cosplay)", "attack": "Criminal Upper"},
{"name": "Juri", "universe": "Street Fighter", "species": "Human (cosplay)", "attack": "Fuhajin"},
{"name": "Poison", "universe": "Street Fighter", "species": "Human (cosplay)", "attack": "Love Me Tender"},
{"name": "Seth", "universe": "Street Fighter", "species": "Human (cosplay)", "attack": "Tanden Engine"},
{"name": "Kage", "universe": "Street Fighter", "species": "Human (cosplay)", "attack": "Dark Hadouken"},
{"name": "Demitri Maximoff", "universe": "Darkstalkers", "species": "Vampire", "attack": "Midnight Bliss"},
{"name": "Morrigan Aensland", "universe": "Darkstalkers", "species": "Demon", "attack": "Finishing Shower"},
{"name": "Felicia", "universe": "Darkstalkers", "species": "Cat-woman", "attack": "Rolling Buckler"},
{"name": "Jon Talbain (Gallon)", "universe": "Darkstalkers", "species": "Werewolf", "attack": "Beast Cannon"},
{"name": "Lord Raptor", "universe": "Darkstalkers", "species": "Musician-rat", "attack": "Death Voltage"},
{"name": "Bishamon", "universe": "Darkstalkers", "species": "Dark Knight", "attack": "Curse Sword"},
{"name": "Anakaris", "universe": "Darkstalkers", "species": "Pharaoh", "attack": "Pharaoh Magic"},
{"name": "Jedah Dohma", "universe": "Darkstalkers", "species": "Demon", "attack": "Prova di Servo"},
{"name": "Huitzil", "universe": "Darkstalkers", "species": "Eagle-demon", "attack": "Plasma Beam"},
{"name": "Pyron", "universe": "Darkstalkers", "species": "Living Fire", "attack": "Inferno"},
{"name": "Mega Man (Rockman)", "universe": "Capcom", "species": "Cyborg", "attack": "Mega Buster"},
{"name": "Zero", "universe": "Capcom", "species": "Cyborg", "attack": "Genmu Zero"},
{"name": "Arthur (Ghosts ’n Goblins)", "universe": "Capcom", "species": "Knight", "attack": "Lance Throw"},
{"name": "Strider Hiryu", "universe": "Capcom", "species": "Ninja", "attack": "Ouroboros"},
{"name": "Captain Commando", "universe": "Capcom", "species": "Soldier", "attack": "Captain Corridor"},
{"name": "Mike Haggar (Final Fight)", "universe": "Capcom", "species": "Wrestler", "attack": "Spinning Lariat"},
{"name": "Guy (Final Fight)", "universe": "Capcom", "species": "Ninja", "attack": "Bushin Musou Renge"},
{"name": "Kyo Kusanagi", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Orochinagi"},
{"name": "Iori Yagami", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Ya Otome"},
{"name": "Terry Bogard", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Buster Wolf"},
{"name": "Mai Shiranui", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Chou Hissatsu Shinobi Bachi"},
{"name": "Athena Asamiya", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Shining Crystal Bit"},
{"name": "Benimaru Nikaido", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Raijinken"},
{"name": "Andy Bogard", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Chou Reppa Dan"},
{"name": "Joe Higashi", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Screw Upper"},
{"name": "Kim Kaphwan", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Hou'ou Kyaku"},
{"name": "Ryo Sakazaki", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Haoh Shokoken"},
{"name": "Robert Garcia", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Ryuu Geki Ken"},
{"name": "Yuri Sakazaki", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Hien Hou'ou Kyaku"},
{"name": "King", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Illusion Dance"},
{"name": "Chin Gentsai", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Gouran Enpou"},
{"name": "Sie Kensou", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Ryuu Gaku Sai"},
{"name": "Goro Daimon", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Kumo Tsukami Nage"},
{"name": "Ralf Jones", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Galactica Phantom"},
{"name": "Clark Still", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Ultra Argentine Backbreaker"},
{"name": "Leona Heidern", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "V-Slasher"},
{"name": "Heidern", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Final Bringer"},
{"name": "Blue Mary", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Mary Typhoon"},
{"name": "Billy Kane", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Sansetsukon Chuudan Uchi"},
{"name": "Choi Bounge", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Hishou Kyaku"},
{"name": "Chang Koehan", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Tekkyuu Dai Kaiten"},
{"name": "Lucky Glauber", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Lucky Vision"},
{"name": "Brian Battler", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Big Bang Tackle"},
{"name": "Heavy D!", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "D. Magnum"},
{"name": "K’ (K Dash)", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Heat Drive"},
{"name": "Maxima", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Double Bomber"},
{"name": "Whip", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Sonic Slaughter"},
{"name": "Kula Diamond", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Diamond Edge"},
{"name": "K9999", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Nightmare Slide"},
{"name": "Angel", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Unchained Circle"},
{"name": "Vanessa", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Puncher Vision"},
{"name": "Ramon", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Tiger Road"},
{"name": "Lin", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Ryuuenjin"},
{"name": "Foxy", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Saber Dance"},
{"name": "May Lee", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Hero Mode"},
{"name": "Shingo Yabuki", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Shingo Kinsei Ore no Kachi da!"},
{"name": "Bao", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Psycho Ball"},
{"name": "Malin", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Malin Present"},
{"name": "Duo Lon", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Genmu Kyaku"},
{"name": "Ash Crimson", "universe": "The King of Fighters", "species": "Human (cosplay)", "attack": "Thermidor"},
{"name": "Rugal Bernstein", "universe": "The King of Fighters", "species": "Villain", "attack": "Genocide Cutter"},
{"name": "Omega Rugal", "universe": "The King of Fighters", "species": "Villain", "attack": "Gravity Smash"},
{"name": "Goenitz", "universe": "The King of Fighters", "species": "Villain", "attack": "Yonokaze"},
{"name": "Orochi", "universe": "The King of Fighters", "species": "Villain", "attack": "120 Shiki: Yaotome"},
{"name": "Krizalid", "universe": "The King of Fighters", "species": "Villain", "attack": "Typhoon Rage"},
{"name": "Zero (KOF)", "universe": "The King of Fighters", "species": "Villain", "attack": "Black Noah"},
{"name": "Igniz", "universe": "The King of Fighters", "species": "Villain", "attack": "Divine Arrow"},
{"name": "Mukai", "universe": "The King of Fighters", "species": "Villain", "attack": "Meidou Seki"},
{"name": "Magaki", "universe": "The King of Fighters", "species": "Villain", "attack": "Sphere of Annihilation"},
{"name": "Saiki", "universe": "The King of Fighters", "species": "Villain", "attack": "Time Manipulation"},
{"name": "Verse", "universe": "The King of Fighters", "species": "Villain", "attack": "Soul Resonance"},
{"name": "Adelheid Bernstein", "universe": "The King of Fighters", "species": "Villain", "attack": "Genocide Heaven"},
{"name": "Evil Ash", "universe": "The King of Fighters", "species": "Villain", "attack": "Hell's Gate"},
{"name": "Marco Rossi", "universe": "Metal Slug", "species": "Human (cosplay)", "attack": "Heavy Machine Gun"},
{"name": "Tarma Roving", "universe": "Metal Slug", "species": "Human (cosplay)", "attack": "Rocket Launcher"},
{"name": "Eri Kasamoto", "universe": "Metal Slug", "species": "Human (cosplay)", "attack": "Multiple Grenades"},
{"name": "Fio Germi", "universe": "Metal Slug", "species": "Human (cosplay)", "attack": "Shotgun"},
{"name": "Trevor Spacey", "universe": "Metal Slug", "species": "Human (cosplay)", "attack": "Rapid Fire"},
{"name": "Nadia Cassel", "universe": "Metal Slug", "species": "Human (cosplay)", "attack": "Flamethrower"},
{"name": "General Donald Morden", "universe": "Metal Slug", "species": "Villain", "attack": "Bazooka"},
{"name": "Allen O'Neil", "universe": "Metal Slug", "species": "Villain", "attack": "Heavy Machine Gun"},
{"name": "Rebel Robot", "universe": "Metal Slug", "species": "Robot", "attack": "Missile Launcher"},
{"name": "Rebel Army", "universe": "Metal Slug", "species": "Army", "attack": "Tanks and Planes"},
{"name": "Mars People (Martians)", "universe": "Metal Slug", "species": "Aliens", "attack": "Laser Beam and Abduction"},
{"name": "Ripster (John Bolton)", "universe": "Street Sharks", "species": "Shark-mutant", "attack": "Steel Bite"},
{"name": "Jab (Clint Bolton)", "universe": "Street Sharks", "species": "Shark-mutant", "attack": "Head Ram"},
{"name": "Streex (Bobby Bolton)", "universe": "Street Sharks", "species": "Shark-mutant", "attack": "Blading Blitz"},
{"name": "Big Slammu (Coop Bolton)", "universe": "Street Sharks", "species": "Shark-mutant", "attack": "Slamu Stomp"},
{"name": "Bends", "universe": "Street Sharks", "species": "Ally", "attack": "Technology Genius"},
{"name": "Moby Lick", "universe": "Street Sharks", "species": "Ally", "attack": "Extendable Tongue"},
{"name": "Rox", "universe": "Street Sharks", "species": "Ally", "attack": "Powerful Jaw"},
{"name": "Mantaman", "universe": "Street Sharks", "species": "Ally", "attack": "Sonic Flight"},
{"name": "El Swordo", "universe": "Street Sharks", "species": "Ally", "attack": "Sword Attacks"},
{"name": "Dr. Luther Paradigm / Dr. Piranoid", "universe": "Street Sharks", "species": "Villain", "attack": "Piranoid Bite"},
{"name": "Slobster", "universe": "Street Sharks", "species": "Villain", "attack": "Giant Claws"},
{"name": "Slash", "universe": "Street Sharks", "species": "Villain", "attack": "Sharp Fins"},
{"name": "Killamari", "universe": "Street Sharks", "species": "Villain", "attack": "Prehensile Tentacles"},
{"name": "Repteel", "universe": "Street Sharks", "species": "Villain", "attack": "Camouflage Tail"},
{"name": "Shrimp Louie", "universe": "Street Sharks", "species": "Villain", "attack": "Quick Claws"},
{"name": "Tentakill", "universe": "Street Sharks", "species": "Villain", "attack": "Multiple Tentacles"},
{"name": "The Raptors (Dino Vengers)", "universe": "Street Sharks", "species": "Villain", "attack": "Dinosaur Attacks"},# === Complete character database (including your new additions)
{ "name": "Goliath", "universe": "Gargoyles", "species": "Gargoyle", "attack": "Superhuman Strength" },
{ "name": "Hudson", "universe": "Gargoyles", "species": "Gargoyle", "attack": "Expert Swordsman" },
{ "name": "Brooklyn", "universe": "Gargoyles", "species": "Gargoyle", "attack": "Extreme Agility" },
{ "name": "Broadway", "universe": "Gargoyles", "species": "Gargoyle", "attack": "Brute Strength" },
{ "name": "Lexington", "universe": "Gargoyles", "species": "Gargoyle", "attack": "Technology Genius" },
{ "name": "Angela", "universe": "Gargoyles", "species": "Gargoyle", "attack": "Flight and Aerial Attack" },
{ "name": "Demona", "universe": "Gargoyles", "species": "Villain (gargoyle)", "attack": "Black Magic" },
{ "name": "David Xanatos", "universe": "Gargoyles", "species": "Human", "attack": "Strategy and Technology" },
{ "name": "Elisa Maza", "universe": "Gargoyles", "species": "Human", "attack": "Police and Combat Skills" },
# --- He-Man ---
{ "name": "He-Man (Prince Adam)", "universe": "He-Man", "species": "Human", "attack": "Sword of Power" },
{ "name": "Skeletor", "universe": "He-Man", "species": "Villain (undead)", "attack": "Havoc Staff" },
{ "name": "Teela", "universe": "He-Man", "species": "Human", "attack": "Sword Fighting and Magic" },
{ "name": "Man-At-Arms", "universe": "He-Man", "species": "Human", "attack": "Weapons and Technology" },
{ "name": "Sorceress", "universe": "He-Man", "species": "Sorceress", "attack": "Magic and Transformation" },
{ "name": "Battle Cat", "universe": "He-Man", "species": "Creature", "attack": "Strength and Charge" },
{ "name": "Trap Jaw", "universe": "He-Man", "species": "Villain (cyborg)", "attack": "Mechanical Arm and Weapons" },
{ "name": "Evil-Lyn", "universe": "He-Man", "species": "Villain (sorceress)", "attack": "Dark Magic and Spells" },
{ "name": "Beast Man", "universe": "He-Man", "species": "Villain (beast-humanoid)", "attack": "Animal Control" },
{ "name": "Merman", "universe": "He-Man", "species": "Villain (merman)", "attack": "Sea Creature Control" },
# --- Ranma ½ ---
{ "name": "Ranma Saotome (male)", "universe": "Ranma ½", "species": "Human (with a curse)", "attack": "Martial Arts and Ki" },
{ "name": "Ranma Saotome (female)", "universe": "Ranma ½", "species": "Human (with a curse)", "attack": "Martial Arts and Ki" },
{ "name": "Akane Tendo", "universe": "Ranma ½", "species": "Human", "attack": "Martial Arts and Brute Strength" },
{ "name": "Ryoga Hibiki", "universe": "Ranma ½", "species": "Human (with a curse)", "attack": "Martial Arts and Ki Explosions" },
{ "name": "Shampoo", "universe": "Ranma ½", "species": "Human (with a curse)", "attack": "Chinese Martial Arts Skills" },
{ "name": "Mousse", "universe": "Ranma ½", "species": "Human (with a curse)", "attack": "Hidden Weapons" },
{ "name": "Genma Saotome (panda)", "universe": "Ranma ½", "species": "Human (with a curse)", "attack": "Panda Style Martial Arts" },
# --- Inuyasha ---
{ "name": "Inuyasha", "universe": "Inuyasha", "species": "Hanyō (half-demon)", "attack": "Tessaiga" },
{ "name": "Kagome Higurashi", "universe": "Inuyasha", "species": "Human", "attack": "Purification Bow and Arrow" },
{ "name": "Sesshomaru", "universe": "Inuyasha", "species": "Demon", "attack": "Tenseiga and Bakusaiga" },
{ "name": "Sango", "universe": "Inuyasha", "species": "Human", "attack": "Hiraikotsu" },
{ "name": "Miroku", "universe": "Inuyasha", "species": "Human", "attack": "Wind Tunnel (Kazana)" },
{ "name": "Shippo", "universe": "Inuyasha", "species": "Fox Demon", "attack": "Illusions and Magic" },
{ "name": "Kikyo", "universe": "Inuyasha", "species": "Priestess", "attack": "Purification Arrows" },
{ "name": "Naraku", "universe": "Inuyasha", "species": "Villain (demon)", "attack": "Poison and Jewel Shard Manipulation" },
# --- Dragon Ball ---
{ "name": "Goku", "universe": "Dragon Ball", "species": "Saiyan", "attack": "Kamehameha" },
{ "name": "Vegeta", "universe": "Dragon Ball", "species": "Saiyan", "attack": "Final Flash" },
{ "name": "Piccolo", "universe": "Dragon Ball", "species": "Namekian", "attack": "Makankosappo" },
{ "name": "Frieza", "universe": "Dragon Ball", "species": "Alien", "attack": "Death Beam" },
{ "name": "Gohan", "universe": "Dragon Ball", "species": "Saiyan-Human Hybrid", "attack": "Masenko" },
{ "name": "Krillin", "universe": "Dragon Ball", "species": "Human", "attack": "Destructo Disc" },
{ "name": "Bulma", "universe": "Dragon Ball", "species": "Human", "attack": "Technology Genius" },
{ "name": "Trunks", "universe": "Dragon Ball", "species": "Saiyan-Human Hybrid", "attack": "Burning Attack" },
{ "name": "Cell", "universe": "Dragon Ball", "species": "Bio-android", "attack": "Perfect Shot" },
{ "name": "Majin Buu", "universe": "Dragon Ball", "species": "Magical Creature", "attack": "Chocolate Beam" },
{ "name": "Beerus", "universe": "Dragon Ball", "species": "God of Destruction", "attack": "Hakke" },
# --- Existing characters (ThunderCats, Sailor Moon, etc.) ---
# ... (you can paste the rest from the previous version if needed)
]
# === Prompt generator function (Python version of your JS logic) ===
def generate_prompt():
if not characters:
return "⚠️ No characters in the database."
char = random.choice(characters)
prompt = f"""
A realistic portrait of an artist, in the style of a cosplayer dressed as the fictional character '{char['name']}', from the universe of '{char['universe']}'. The cosplayer has the anatomy, physique, and expressions of the character.
They wear the detailed uniform and attire, with the accessories and elements that characterize them, and perform their most characteristic attack or ability in a realistic way: '{char['attack']}'.
The cosplayer's pose must be dynamic, hyper-realistic, and epic, without any blur.
The image must have a medium-shot framing, a neutral background, and be lit with front lighting to appreciate every detail.
The character's proportions are that of a '{char['species']}', and the skin and clothing textures are very realistic, with an extraordinary level of detail.
The artistic style must be photorealistic.
""".strip()
return prompt
# === Custom CSS for styling (clean and modern) ===
custom_css = """
body {
font-family: Arial, sans-serif;
background: #111;
color: #eee;
}
.container {
max-width: 960px;
margin: auto;
padding: 2rem;
}
h1 {
color: #ffcc00;
text-align: center;
}
.description {
text-align: center;
font-size: 1.1rem;
margin-bottom: 1.5rem;
color: #ccc;
}
button.primary {
background: #ff6600 !important;
color: white !important;
border: none !important;
padding: 0.8rem 1.5rem !important;
font-size: 1.1rem !important;
border-radius: 5px !important;
margin-top: 1rem;
}
button.primary:hover {
background: #ff8800 !important;
}
#output-text {
background: #222 !important;
color: #fff !important;
border: 1px solid #444 !important;
font-family: monospace !important;
}
.footer {
font-size: 0.9rem;
color: #aaa;
margin-top: 2rem;
text-align: center;
}
"""
# === Gradio Interface ===
with gr.Blocks(css=custom_css) as demo:
gr.HTML("""
<div class="container">
<h1>BATUTO‑VERSE Prompt Generator</h1>
<p class="description">Generates a hyper‑realistic prompt for any character from the BATUTO‑VERSE universe.</p>
""")
output = gr.Textbox(
label="Generated Prompt",
placeholder="Click 'Generate Prompt' to see the result...",
elem_id="output-text",
lines=12
)
gen_btn = gr.Button("Generate Prompt", variant="primary")
gr.HTML("""
<p class="footer">
⚙️ The prompt is created from the universal template and the data stored in the embedded JSON database.
You can add or edit characters directly in the <code>characters</code> list.
</p>
</div>
""")
# Connect button to function
gen_btn.click(fn=generate_prompt, inputs=[], outputs=output)
# Launch the app
demo.launch()