Saravutw's picture
Update app.py
28fcd37 verified
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()