File size: 1,819 Bytes
bfdcea4
 
1a89101
 
36deab8
 
 
 
 
 
 
 
1a89101
 
bfdcea4
 
85091b0
bfdcea4
 
 
 
 
7b6a755
4366a57
 
bfdcea4
204b625
 
bfdcea4
 
 
1a89101
 
204b625
 
1a89101
204b625
 
 
 
 
 
 
bfdcea4
204b625
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import gradio as gr

# Function to convert standard Space ID to Direct App URL
def get_embed_url(space_id):
    # 1. Convert to lowercase (Domains must be lowercase)
    lower_id = space_id.lower()
    
    # 2. Replace slash '/' with hyphen '-'
    # 3. CRITICAL FIX: Replace underscore '_' with hyphen '-'
    # Because subdomains cannot contain underscores
    domain_friendly_id = lower_id.replace("/", "-").replace("_", "-")
    
    return f"https://{domain_friendly_id}.hf.space"

spaces_list = [
    ("Wan2.2 Faster", "dream2589632147/Dream-wan2-2-faster-Pro"),
    ("LTX Video", "dream2589632147/Dream-ltx-video-distilled"),
    ("Qwen Image Edit", "dream2589632147/Dream-Qwen-Image-Edit-Angles"),
    ("Audio Separator", "dream2589632147/Dream-Audio_separator-pro"),
    ("Video BG Removal", "dream2589632147/Dream-video-background-removal"),
    ("F-E Farm", "dream2589632147/Dream-F-E-farm"),
    ("Video Enhancer 4K", "dream2589632147/Dream-AI_Video_Enhancer_4K"),
    ("Stockfish-Chess-Ultra", "dream2589632147/Dream-Stockfish-Chess-Ultra"),

 ]

with gr.Blocks(title="Dream Hub Pro") as demo:
    gr.Markdown("# πŸš€ Dream AI Studio Pro \n ### The Ultimate AI Tools Suite")
    
    for tab_name, space_id in spaces_list:
        with gr.Tab(tab_name):
            embed_url = get_embed_url(space_id)
            # Displaying the Direct App URL
            gr.HTML(f"""
                <iframe 
                    src="{embed_url}" 
                    width="100%" 
                    height="900px" 
                    frameborder="0" 
                    allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; webcam; microphone" 
                    allowfullscreen>
                </iframe>
            """)

if __name__ == "__main__":
    demo.launch()