Spaces:
Runtime error
Runtime error
Commit
·
f4f0e5b
1
Parent(s):
8961b93
Set environment variables for CUDA and Hugging Face paths; increase image prompt height and enable sharing for demo launch
Browse files
app.py
CHANGED
|
@@ -9,6 +9,7 @@ import os
|
|
| 9 |
os.environ['SPCONV_ALGO'] = 'native'
|
| 10 |
from typing import *
|
| 11 |
import torch
|
|
|
|
| 12 |
import numpy as np
|
| 13 |
import imageio
|
| 14 |
import uuid
|
|
@@ -239,7 +240,7 @@ with gr.Blocks(title="Game Items Generator") as demo:
|
|
| 239 |
item_text_field = gr.Textbox(label="Item Name", placeholder="Enter the name of the item", lines=2, scale=4)
|
| 240 |
enhance_prompt_btn = gr.Button("Enhance Prompt", variant="primary", scale=1)
|
| 241 |
generate_image_btn = gr.Button("Generate Image", variant="primary")
|
| 242 |
-
image_prompt = gr.Image(label="Image Prompt", image_mode="RGBA", type="pil", height=
|
| 243 |
|
| 244 |
with gr.Accordion(label="Generation Settings", open=False):
|
| 245 |
seed = gr.Slider(0, MAX_SEED, label="Seed", value=0, step=1)
|
|
@@ -358,4 +359,4 @@ if __name__ == "__main__":
|
|
| 358 |
pipeline.preprocess_image(Image.fromarray(np.zeros((512, 512, 3), dtype=np.uint8))) # Preload rembg
|
| 359 |
except:
|
| 360 |
pass
|
| 361 |
-
demo.launch()
|
|
|
|
| 9 |
os.environ['SPCONV_ALGO'] = 'native'
|
| 10 |
from typing import *
|
| 11 |
import torch
|
| 12 |
+
print(torch.__version__)
|
| 13 |
import numpy as np
|
| 14 |
import imageio
|
| 15 |
import uuid
|
|
|
|
| 240 |
item_text_field = gr.Textbox(label="Item Name", placeholder="Enter the name of the item", lines=2, scale=4)
|
| 241 |
enhance_prompt_btn = gr.Button("Enhance Prompt", variant="primary", scale=1)
|
| 242 |
generate_image_btn = gr.Button("Generate Image", variant="primary")
|
| 243 |
+
image_prompt = gr.Image(label="Image Prompt", image_mode="RGBA", type="pil", height=400)
|
| 244 |
|
| 245 |
with gr.Accordion(label="Generation Settings", open=False):
|
| 246 |
seed = gr.Slider(0, MAX_SEED, label="Seed", value=0, step=1)
|
|
|
|
| 359 |
pipeline.preprocess_image(Image.fromarray(np.zeros((512, 512, 3), dtype=np.uint8))) # Preload rembg
|
| 360 |
except:
|
| 361 |
pass
|
| 362 |
+
demo.launch(share=True)
|