import json import re from urllib.parse import urlparse # Load creds with open("/home/creserver/Desktop/Vaishno_workspace/Jsons/credentials_23-10-2026.json") as f: creds_raw = json.load(f) creds = creds_raw["data"] # Load existing index.html with open("web/docs/index.html") as f: html = f.read() m = re.search(r'', html, re.DOTALL) old_data = json.loads(m.group(1)) # Collect all existing endpoints all_eps = {} for s in old_data["sections"]: for ep in s["eps"]: all_eps[ep["path"]] = ep all_eps[ep["id"]] = ep print(f"Loaded {len(creds)} credentials and {len(all_eps)} endpoint lookups.") # Map creds to list of endpoints # We will create an API entry for each cred in creds api_list = [] # Mapping dictionary for APIs with specific endpoints custom_mappings = { "Cre_Aws_Waifu2x_Model": [ ("/new_enhancer/image/", "image/", "Real-ESRGAN + CodeFormer Super-Resolution"), ("/new_enhancer/image_previous/", "image_previous/", "Face & Image Enhancer — Legacy Alias") ], "Cre_Aws_Colorization_Model": [ ("/colorization/image/", "image/", "DeOldify B&W Photo Colorization") ], "Cre_Aws_Old_Photo_Restore_Model": [ ("/oldPhotoRestore/image/", "image/", "Scratch, Crease & Fading Restoration") ], "Cre_Aws_Advance_Image_Segment_Anything_Dichotomous_Model": [ ("/advance_image_segment_anything_dichotomous/image/", "image/", "DIS + SAM Dichotomous Segmentation") ], "Cre_Aws_cloth_segmentation_Model": [ ("/cloth_segmentation/image", "image", "Cloth Segmentation (Clothing Identifier)") ], "Cloth_Segmentation_Model_V2": [ ("/cloth_segmentation_v2/segment/", "segment/", "Cloth Segmentation V2 (Multi-Part Router)") ], "dress_segmentation_auto": [ ("/dress_segmentation_auto_newurl/image/", "image/", "Automated Garment Segmentation") ], "Cre_Aws_Lama_Cleaner_Model": [ ("/lamaCleaner/image/", "image/", "LaMa Inpainting Object Remover") ], "Cre_Aws_Background_Remover_Model": [ ("/background_remover_p3m/image/", "image/", "P3M-Net Alpha Matte Background Remover") ], "Cre_Aws_Cartoon_Model": [ ("/cartoon_effects/image/", "image/", "AnimeGAN & Cartoon Effects") ], "Face_Coordinates": [ ("/face_landmark/image/", "image/", "68-Point & 468-Point Facial Landmark Detection"), ("/face_landmark/image2/", "image2/", "Face Landmark — Mesh Array (image2)"), ("/face_landmark/image3/", "image3/", "Face Landmark — Contour (image3)"), ("/face_landmark/image4/", "image4/", "Face Landmark — Variant 4 (image4)"), ("/face_landmark/image5/", "image5/", "Face Landmark — Variant 5 (image5)"), ("/face_landmark/image6/", "image6/", "Face Landmark — Eye Iris Mask (image6)"), ("/face_landmark/image7/", "image7/", "Face Landmark — Visualized Overlay PNG (image7)"), ("/face_landmark/get_eye_mask", "get_eye_mask", "Face Landmark — Fetch Eye Mask (get_eye_mask)") ], "Face_Swapper": [ ("/face_swapper/image/", "image/", "InsightFace Single & Couple Face Swapper"), ("/face_swapper/couple_swap/", "couple_swap/", "Couple Face Swap (Two Source Targets)"), ("/face_swapper/eyes/", "eyes/", "Eye Region Targeted Swap"), ("/face_swapper/open_eye_new/", "open_eye_new/", "Open Eye Blink Corrector"), ("/face_swapper/couple_swap_single/", "couple_swap_single/", "Couple Swap (Single Source Template)") ], "Teeth_Whitener": [ ("/teeth_whitener/image/", "image/", "Natural CIELAB Teeth Whitener"), ("/teeth_whitener/image_full/", "image_full/", "Full Aggressive Teeth Whitener") ], "Blemish_Remover": [ ("/blemish_remover/image/", "image/", "Blemish Remover, Eye Fix & Skin Improver"), ("/blemish_remover/improver/", "improver/", "Blemish Remover — Skin Improver & Eye Fix") ], "Eye_Bag_Remover": [ ("/eye_bag_remover/image/", "image/", "Under-Eye Bag & Dark Circle Remover") ], "Eye_Redness_Remover": [ ("/eye_redness_remover/image/", "image/", "Eye Redness & Flash Sclera Corrector") ], "Face_Analyzer": [ ("/skin_analyzer/analyze", "analyze", "Comprehensive AI Skin Health & Metrics Analyzer") ], "Skin_Detection": [ ("/skin_detection/image/", "image/", "Skin Detection & Mask Extractor") ], "Sky_Detection": [ ("/sky_detection/image/", "image/", "Sky Detection & Horizon Mask Extractor") ], "Pose_Detection": [ ("/pose_detection/image/", "image/", "MediaPipe & OpenPose Keypoint Detection") ], "Cre_Face_With_Hair_Segment_Model": [ ("/face_hair_segmentation/image/", "image/", "Dual Face & Hair Multi-Channel Segmentation") ], "Cre_Hair_Detection_Segment_Model": [ ("/hair_segmentation/image/", "image/", "High-Precision Hair Segmentation"), ("/hair_segmentation_yolo_sam/image/", "yolo_sam/", "Hair Segmentation YOLO + SAM") ], "Stable_Diffusion_Hair_Segmentation": [ ("/stable_diffusion_hair_segmentation/image/", "image/", "Stable Diffusion Hair Segmentation Router") ], "Stable_Diffusion_Hair_Color_Changer_And_Hair_Style_Changer": [ ("/flux_fill/hair_color_changer/image/", "hair_color_changer/", "FLUX.1-Fill Hair Color Changer (36 Presets)"), ("/flux_fill/hair_style_changer/image/", "hair_style_changer/", "FLUX.1-Fill Hair Style Changer (60 Presets)") ], "Stable_Diffusion_Eye_Changer": [ ("/flux_fill/eye_changer/image/", "image/", "FLUX.1-Fill Eye Color & Eyewear Inpainting") ], "Flux_Dress_Changer": [ ("/flux_fill/dress_changer/image/", "image/", "FLUX.1-Fill Wardrobe Restyling & Outfits") ], "Flux_Couple_Dress_Changer": [ ("/flux_fill/couple_dress_changer/image/", "image/", "FLUX.1-Fill Couple Outfits & Fashion") ], "Stable_Diffusion_Headshot": [ ("/flux/headshots/image1_1/", "image1_1/", "FLUX.1-Kontext Professional Studio Headshots") ], "Stable_Diffusion_Head_Cartoon_Effects": [ ("/flux/head_cartoon_effect/image/", "image/", "FLUX.1-Kontext Head Cartoon Effect") ], "Stable_Diffusion_Modified_Head_Cartoon_Effects": [ ("/flux/modified_head_cartoon_effects/image/", "image/", "FLUX.1-Kontext Modified Head Cartoon Effects") ], "Stable_Diffusion_Comic_Coverpage_Generator": [ ("/flux/comic_cover/image/", "image/", "FLUX.1-Kontext Comic Cover Art") ], "Flux_Hairstyles": [ ("/flux/hairstyles/image/", "image/", "FLUX.1-Kontext Hairstyles Inpainting") ], "Flux_Sculpture_Effect": [ ("/flux/sculptures/image/", "image/", "FLUX.1-Kontext Classical & Modern Sculpture Stylization") ], "Flux_Silhouette_Effect": [ ("/flux/silhouette/image/", "image/", "FLUX.1-Kontext Artistic Silhouette Maker") ], "Flux_Glasses": [ ("/flux/glasses_maker/image/", "image/", "FLUX.1-Kontext Eyewear & Sunglasses Stylizer") ], "Flux_Cartoon": [ ("/flux/cartoon/image/", "image/", "FLUX.1-Kontext Stylized Cartoon Effect") ], "Flux_Background_Changer": [ ("/flux/background_with_depth/image/", "image/", "FLUX.1-Kontext Background With Depth") ], "Vintage_Look": [ ("/flux/vintage_look/image/", "image/", "FLUX.1-Kontext Vintage Film & Retro Emulation") ], "Stable_Diffusion_Text_To_Image_Model": [ ("/sdxl/text_to_image/image/", "image/", "SDXL RealVisXL Text to Image Generation") ], "Stable_Diffusion_Outpainting": [ ("/sdxl/outpainting/image/", "image/", "SDXL RealVisXL Outpainting & Canvas Extender") ], "Stable_Diffusion_Inpaint_Object_Replacer": [ ("/sdxl/inpaint_object_replacer/image/", "image/", "SDXL Inpaint Object Replacer") ], "Stable_Diffusion_Dress_Pattern": [ ("/sdxl/dress_pattern/image/", "image/", "SDXL Dress Pattern & Fabric Inpainter") ], "Stable_Diffusion_Blend_Collage": [ ("/sdxl/blend_collage/image/", "image/", "SDXL RealVisXL Blend Collage") ], "Stable_Diffusion_Dress_Replacer": [ ("/sdxl/dress_replacer/image/", "image/", "SDXL RealVisXL Dress Replacer") ], "Stable_Diffusion_Text_To_Cartoon_Character_Generator": [ ("/sdxl/text_to_cartoon/image/", "image/", "SDXL Text to Cartoon Character Generator") ], "Stable_Diffusion_Dress_Changer": [ ("/dress-changer/image/", "image/", "ComfyUI Sapiens Skin-Seg Dress Changer") ], "Stable_Diffusion_Text_To_Caricature": [ ("/sdxl/text_to_caricature/image/", "image/", "SDXL Text to Caricature Generation") ], "Stable_Diffusion_Face_Expressions_Changer": [ ("/sdxl/expressions_changer/image/", "image/", "SDXL Facial Expressions Changer") ], "Multi_Segmentation_Model": [ ("/multi_segmentation_yolo_sam/image/", "image/", "ComfyUI Multi-Segmentation (YOLO + SAM)") ], "Stable_Diffusion_Image_To_Image_Model": [ ("/stable_diffusion/image/", "image/", "Stable Diffusion 1.5 General Inpainting") ], "Stable_Diffusion_Realistic_Avatar": [ ("/stable_diffusion_avatar_with_original_face/image/", "image/", "Avatar with Original Face (FaceID + Roop)") ], "Cre_Cartoonify_Caricature_Effects_Model": [ ("/cartoonify_caricature_effects/image/", "image/", "CartoonGAN & Anime Stylizer") ], "Stable_Diffusion_Art_Style_Transfer": [ ("/stable_diffusion_art_style_transfer/image/", "image/", "Fine-Art Style Transfer (Neural Style)") ], "Stable_Diffusion_Reaslistic_Background_Changer": [ ("/stable_diffusion_realistic_background_changer/image/", "image/", "Realistic Background Changer (SD1.5)") ], "Stable_Diffusion_Silhouette_Maker": [ ("/flux/silhouette/image/", "image/", "Silhouette & Shadow Profile Generator") ], "Stable_Diffusion_Caricature_Effects": [ ("/stable_diffusion_caricature_effects/image/", "image/", "Caricature Effects Pipeline") ], "Stable_Diffusion_Comic_Generator": [ ("/stable_diffusion_comic_generator/image/", "image/", "Comic Panel Generator") ], "Stable_Diffusion_Photo_2_Caricature": [ ("/stable_diffusion_photo_2_caricature/image/", "image/", "Photo to Caricature Converter") ], "Stable_Diffusion_Caricature_Hair_Face_Effect": [ ("/stable_diffusion_caricature_hair_face_effect/image/", "image/", "Caricature Hair & Face Effect") ], "Caricature_Avatar": [ ("/caricature_avatar/image/", "image/", "Caricature Avatar Composite Pipeline"), ("/caricature_avatar/image1/", "image1/", "Caricature Avatar — Couple Composite (image1)"), ("/caricature_avatar/single_couple_image/", "single_couple_image/", "Caricature Avatar — Single Source Couple Template") ], "Polaroid_Effect": [ ("/polaroid_effect/image/", "image/", "Vintage Polaroid Frame & Film Emulation") ], "Stable_Diffusion_Relighter": [ ("/relighting_effect/image/", "image/", "Neural Studio Relighting & Shadow Synthesizer") ], "Stable_Diffusion_New_Cartoon Effects": [ ("/stable_diffusion_new_cartoon_effects/image/", "image/", "New Cartoon Effects (Artistic Cel & Anime)") ], "Stable_Diffusion_Artistic_Effects": [ ("/stable_diffusion_artistic_effects/image/", "image/", "Artistic Effects with Gender Detection") ], "Feedbacks": [ ("/feedback/submit/", "submit/", "User Feedback & Model Quality Rating") ], "Reports": [ ("/reports/data/", "data/", "Bug Reports & Diagnostics Collector") ], "Credits_Limit": [ ("/credits/use", "credits/use", "Credits & Billing Client API"), ("/credits/admin/api/accounts", "credits/admin/api/accounts", "Credits Admin Portal & REST CRUD API") ], "Trendy": [ ("/trendy/image/", "image/", "Trendy AI Stylization Filter") ] } print(f"Total custom mapped APIs: {len(custom_mappings)}") for k in creds: key = k["api_key"] if key not in custom_mappings: print(f"Missing mapping for: {key}")