File size: 1,151 Bytes
a50cb3d
6d492cc
28fcd37
 
 
 
a50cb3d
28fcd37
230a85a
28fcd37
 
 
 
 
 
 
a50cb3d
28fcd37
 
 
 
 
 
7f073e6
9bcdd1b
6d492cc
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
import gradio as gr

# เปลี่ยน URL เป็นเวอร์ชัน "embed" (สำคัญมาก)
# จากเดิม: https://huggingface.co/spaces/selfit-camera/omni-image-editor
# เป็น: https://selfit-camera-omni-image-editor.hf.space (Direct Link)
source_space_url = "https://selfit-camera-omni-image-editor.hf.space"

print("=== กำลังโหลดหน้า Interface ผ่าน Direct Embed Link ===")

with gr.Blocks(fill_height=True) as demo:
    # ใช้ Iframe ชี้ไปที่ Direct Link ของ Space นั้นๆ
    # วิธีนี้จะไม่โดนปฏิเสธการเชื่อมต่อ (Refused to connect)
    gr.HTML(f"""
        <iframe 
            src="{source_space_url}" 
            frameborder="0" 
            width="100%" 
            height="100%" 
            style="min-height: 800px; border-radius: 8px;"
            allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; getattr" 
            allowfullscreen>
        </iframe>
    """)

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