Spaces:
Runtime error
Runtime error
RoyalEagle
commited on
Commit
•
d7ecba7
1
Parent(s):
3124a19
Delete app.ipynb
Browse files
app.ipynb
DELETED
@@ -1,54 +0,0 @@
|
|
1 |
-
!pip install torch==1.9.0+cu111 torchtext==0.10.0 torchvision==0.10.0+cu111 -f https://download.pytorch.org/whl/torch/ -f https://download.pytorch.org/whl/torchvision/
|
2 |
-
|
3 |
-
!git clone https://github.com/openai/CLIP
|
4 |
-
# !pip install taming-transformers
|
5 |
-
!git clone https://github.com/CompVis/taming-transformers.git
|
6 |
-
!rm -Rf pixray
|
7 |
-
!git clone https://github.com/dribnet/pixray
|
8 |
-
!pip install ftfy regex tqdm omegaconf pytorch-lightning
|
9 |
-
!pip install kornia==0.6.1
|
10 |
-
!pip install imageio-ffmpeg
|
11 |
-
!pip install einops
|
12 |
-
!pip install torch-optimizer
|
13 |
-
!pip install easydict
|
14 |
-
!pip install braceexpand
|
15 |
-
!pip install git+https://github.com/pvigier/perlin-numpy
|
16 |
-
!mkdir steps
|
17 |
-
!mkdir models
|
18 |
-
!wget https://user-images.githubusercontent.com/945979/126260797-adc60317-9518-40de-8700-b1f93e81e0ec.png -O this_is_fine.png
|
19 |
-
!wget https://user-images.githubusercontent.com/945979/126415385-d70ff2b0-f021-4238-9621-6180d33b242c.jpg -O perfume.jpg
|
20 |
-
!pip install gradio==2.5.1
|
21 |
-
import sys
|
22 |
-
sys.path.append("pixray")
|
23 |
-
|
24 |
-
import gradio as gr
|
25 |
-
import torch
|
26 |
-
import pixray
|
27 |
-
|
28 |
-
# Define the main function
|
29 |
-
def generate(prompt, quality, style, aspect):
|
30 |
-
torch.cuda.empty_cache()
|
31 |
-
pixray.reset_settings()
|
32 |
-
|
33 |
-
# use_pixeldraw = (style == 'pixel art')
|
34 |
-
# use_clipdraw = (style == 'painting')
|
35 |
-
pixray.add_settings(prompts=prompt,
|
36 |
-
aspect=aspect,
|
37 |
-
quality=quality,
|
38 |
-
make_video=True)
|
39 |
-
|
40 |
-
settings = pixray.apply_settings()
|
41 |
-
pixray.do_init(settings)
|
42 |
-
pixray.do_run(settings)
|
43 |
-
|
44 |
-
return 'output.png', 'output.mp4'
|
45 |
-
|
46 |
-
# Create the UI
|
47 |
-
prompt = gr.inputs.Textbox(default="Underwater city", label="Text Prompt")
|
48 |
-
quality = gr.inputs.Radio(choices=['draft', 'normal', 'better'], label="Quality")
|
49 |
-
# style = gr.inputs.Radio(choices=['image', 'painting','pixel art'], label="Type")
|
50 |
-
aspect = gr.inputs.Radio(choices=['square', 'widescreen','portrait'], label="Size")
|
51 |
-
|
52 |
-
# Launch the demo
|
53 |
-
iface = gr.Interface(generate, inputs=[prompt, quality, aspect], outputs=['image', 'video'], enable_queue=True, live=False)
|
54 |
-
iface.launch(debug=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|