NexaCoders commited on
Commit
2ce0ded
ยท
verified ยท
1 Parent(s): 5616aeb

Delete app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -105
app.py DELETED
@@ -1,105 +0,0 @@
1
- import gradio as gr
2
- import requests
3
- import json
4
- from typing import Dict, Any
5
-
6
- SPACE_URL = "https://huggingface.co/spaces/NexaCoders/NexaClothes"
7
-
8
- # ๐Ÿ”ฅ SEXY PRESETS
9
- PRESETS = {
10
- "๐Ÿ”ฅ Slutty": {
11
- "top": "sheer_top_white", "bra": None, "boobs": "nipple_show",
12
- "bottom": "thong_visible", "shoes": "heels_red"
13
- },
14
- "๐Ÿ˜ Bikini": {
15
- "top": "bikini_top_red", "bra": "pushup_black", "boobs": "visible",
16
- "bottom": "miniskirt_black", "shoes": "sandals_strappy"
17
- },
18
- "๐Ÿ’‹ Crop Top": {
19
- "top": "crop_top_pink", "bra": "lace_pink", "boobs": "enhanced",
20
- "bottom": "hotpants_denim", "shoes": "platforms"
21
- }
22
- }
23
-
24
- def get_outfit(user_id: str = "Nexa") -> str:
25
- try:
26
- r = requests.get(f"{SPACE_URL}/api/avatar/{user_id}", timeout=10)
27
- return json.dumps(r.json(), indent=2)
28
- except:
29
- return "โŒ API Error - Check server"
30
-
31
- def change_clothes(user_id: str, category: str, item: str) -> str:
32
- try:
33
- r = requests.patch(
34
- f"{SPACE_URL}/api/avatar/{user_id}/clothes/{category}",
35
- json={"item": item},
36
- timeout=10
37
- )
38
- return json.dumps(r.json(), indent=2)
39
- except Exception as e:
40
- return f"โŒ Error: {str(e)}"
41
-
42
- def load_preset(user_id: str, preset: str) -> str:
43
- try:
44
- preset_data = PRESETS[preset]
45
- r = requests.put(f"{SPACE_URL}/api/avatar/{user_id}", json=preset_data, timeout=10)
46
- return json.dumps(r.json(), indent=2)
47
- except:
48
- return "โŒ Preset Error"
49
-
50
- # GRADIO UI
51
- with gr.Blocks(
52
- title="๐Ÿ”ฅ NexaClothes - Sexy Avatar API",
53
- theme=gr.themes.Soft()
54
- ) as demo:
55
-
56
- gr.Markdown("""
57
- # ๐Ÿ‘— **NexaClothes API** - 200+ Sexy Clothes
58
- Change avatar outfits instantly! **LIVE API**
59
- """)
60
-
61
- with gr.Tabs():
62
- with gr.TabItem("๐ŸŽฎ Quick Change"):
63
- with gr.Row():
64
- with gr.Column(scale=1):
65
- user_id = gr.Textbox("Nexa", label="๐Ÿ‘ค User ID")
66
- category = gr.Dropdown(
67
- choices=list(CLOTHES.keys()),
68
- value="top",
69
- label="๐Ÿ‘š Category"
70
- )
71
- item_input = gr.Textbox(label="๐Ÿ‘— Item Name")
72
- change_btn = gr.Button("๐Ÿ”„ CHANGE CLOTHES", variant="primary", scale=2)
73
-
74
- result = gr.JSON(label="๐Ÿ“‹ Current Outfit")
75
-
76
- gr.Examples([
77
- ["Nexa", "top", "sheer_top_white"],
78
- ["Nexa", "bra", "null"],
79
- ["Nexa", "boobs", "nipple_show"],
80
- ["Nexa", "bottom", "thong_visible"]
81
- ], [user_id, category, item_input], fn=change_clothes, outputs=result)
82
-
83
- with gr.TabItem("โœจ Presets"):
84
- with gr.Row():
85
- preset_user = gr.Textbox("Nexa", label="User ID")
86
- presets = gr.Dropdown(list(PRESETS.keys()), label="Choose Look")
87
- preset_btn = gr.Button("๐ŸŽจ LOAD PRESET", variant="primary")
88
- preset_result = gr.JSON(label="Outfit Loaded")
89
-
90
- preset_btn.click(load_preset, [preset_user, presets], preset_result)
91
-
92
- with gr.TabItem("๐Ÿ” API Test"):
93
- gr.Markdown("""
94
- ```
95
- GET /api/avatar/Nexa
96
- PATCH /api/avatar/Nexa/clothes/top {"item": "bikini_top_red"}
97
- POST /api/avatar/Nexa/random
98
- ```
99
- """)
100
- api_test = gr.Button("๐Ÿงช Test API Health")
101
- api_result = gr.JSON(value="Click to test!")
102
-
103
- # Launch
104
- if __name__ == "__main__":
105
- demo.launch(server_name="0.0.0.0", server_port=7861)