chahui commited on
Commit
9de5fe5
·
verified ·
1 Parent(s): 9f4131d

Upload 4 files

Browse files
Files changed (2) hide show
  1. Dockerfile +17 -0
  2. README.md +32 -34
Dockerfile ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ # Set working directory
4
+ WORKDIR /app
5
+
6
+ # Copy requirements and install dependencies
7
+ COPY requirements.txt .
8
+ RUN pip install --upgrade pip && pip install -r requirements.txt
9
+
10
+ # Copy application code
11
+ COPY app.py .
12
+
13
+ # Expose port for Gradio
14
+ EXPOSE 7860
15
+
16
+ # Run the app
17
+ CMD ["python", "app.py"]
README.md CHANGED
@@ -1,34 +1,32 @@
1
- ---
2
- title: "WorldGen Text-to-3D"
3
- colorFrom: "blue"
4
- colorTo: "purple"
5
- sdk: "gradio"
6
- sdk_version: "5.44.0"
7
- python_version: 3.11
8
- app_file: "app.py"
9
- pinned: false
10
- ---
11
-
12
- # WorldGen — Text -> 3D Scene (Hugging Face Spaces)
13
-
14
- This Space provides a minimal Text -> 3D demo using the open-source WorldGen project.
15
-
16
- ## Quick start
17
- 1) Open the Space and enter an English scene description.
18
- 2) Click "Generate". A ZIP file with 3D outputs will appear for download.
19
-
20
- > Tip: On free CPU it will be very slow and may timeout. Switch the Space hardware to a GPU (T4/A10G) for practical generation.
21
-
22
- ## Environment
23
- - Python 3.11 (set via the YAML block above)
24
- - Gradio 5.x (set via sdk_version)
25
-
26
- ## Dependencies
27
- We keep requirements minimal so pip can resolve versions:
28
- - torch>=2.7 (required by WorldGen)
29
- - websockets>=13.1 (required by viser used inside WorldGen)
30
- - WorldGen from GitHub
31
-
32
- ## Notes
33
- - This app disables CUDA and evaluation at runtime to avoid GPU-only/compiled ops when running on CPU.
34
- - Temporary outputs are cleaned a few minutes after each run to avoid hitting the 50GB ephemeral disk limit.
 
1
+ # WorldGen • Text-to-3D Scene Generator
2
+
3
+ This Hugging Face Space allows you to generate 3D scenes from English text prompts using the WorldGen framework.
4
+
5
+ ## 🚀 How to Use
6
+
7
+ 1. Enter a scene description in English (e.g., `a neon-lit cyberpunk street with rain reflections, highly detailed`)
8
+ 2. Click **Generate 3D Scene**
9
+ 3. Download the ZIP file containing the generated 3D assets
10
+
11
+ ## 🔐 Hugging Face Token
12
+
13
+ This app downloads model files from Hugging Face Hub. If you encounter `401 Unauthorized` errors, you may need to provide a Hugging Face token.
14
+
15
+ ### Setting Token in Space
16
+
17
+ 1. Go to your Space **Settings** **Secrets**
18
+ 2. Add a new secret:
19
+ - Name: `HF_TOKEN`
20
+ - Value: your Hugging Face access token
21
+
22
+ The app will automatically read this token via `os.getenv("HF_TOKEN")`.
23
+
24
+ ## ⚙️ Runtime Notes
25
+
26
+ - CPU-only mode is enabled by default to avoid CUDA errors
27
+ - Temporary files are cleaned automatically after each run
28
+ - Model files are downloaded from `mit-han-lab/svdq-int4-flux.1-dev`
29
+
30
+ ## 📦 Dependencies
31
+
32
+ See `requirements.txt` for full dependency list.