phenomenon1981
commited on
Commit
•
fc2b285
1
Parent(s):
d1dca0f
Update app.py
Browse files
app.py
CHANGED
@@ -3,40 +3,17 @@ import os
|
|
3 |
import sys
|
4 |
import torch
|
5 |
import random
|
6 |
-
import time
|
7 |
from pathlib import Path
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
|
|
|
12 |
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
seed = int(time.time())
|
18 |
-
torch.manual_seed(seed)
|
19 |
-
proc3 = gr.Interface.load("models/dreamlike-art/dreamlike-photoreal-2.0")
|
20 |
-
|
21 |
-
seed = int(time.time())
|
22 |
-
torch.manual_seed(seed)
|
23 |
-
proc4 = gr.Interface.load("models/dreamlike-art/dreamlike-photoreal-2.0")
|
24 |
-
|
25 |
-
seed = int(time.time())
|
26 |
-
torch.manual_seed(seed)
|
27 |
-
proc5 = gr.Interface.load("models/dreamlike-art/dreamlike-diffusion-1.0")
|
28 |
-
|
29 |
-
seed = int(time.time())
|
30 |
-
torch.manual_seed(seed)
|
31 |
-
proc6 = gr.Interface.load("models/dreamlike-art/dreamlike-diffusion-1.0")
|
32 |
-
|
33 |
-
seed = int(time.time())
|
34 |
-
torch.manual_seed(seed)
|
35 |
-
proc7 = gr.Interface.load("models/dreamlike-art/dreamlike-diffusion-1.0")
|
36 |
-
|
37 |
-
seed = int(time.time())
|
38 |
-
torch.manual_seed(seed)
|
39 |
-
proc8 = gr.Interface.load("models/dreamlike-art/dreamlike-diffusion-1.0")
|
40 |
|
41 |
|
42 |
text_gen=gr.Interface.load("spaces/Omnibus/MagicPrompt-Stable-Diffusion")
|
@@ -84,6 +61,46 @@ with gr.Blocks() as myface:
|
|
84 |
|
85 |
prompt=gr.Textbox(label="Prettified Prompt")
|
86 |
run=gr.Button("Launch")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
|
88 |
|
89 |
with gr.Row():
|
|
|
3 |
import sys
|
4 |
import torch
|
5 |
import random
|
|
|
6 |
from pathlib import Path
|
7 |
|
8 |
+
proc1=gr.Interface.load("models/dreamlike-art/dreamlike-photoreal-2.0")
|
9 |
+
proc2=gr.Interface.load("models/dreamlike-art/dreamlike-photoreal-2.0")
|
10 |
+
proc3=gr.Interface.load("models/dreamlike-art/dreamlike-photoreal-2.0")
|
11 |
+
proc4=gr.Interface.load("models/dreamlike-art/dreamlike-photoreal-2.0")
|
12 |
|
13 |
+
proc5=gr.Interface.load("models/dreamlike-art/dreamlike-diffusion-1.0")
|
14 |
+
proc6=gr.Interface.load("models/dreamlike-art/dreamlike-diffusion-1.0")
|
15 |
+
proc7=gr.Interface.load("models/dreamlike-art/dreamlike-diffusion-1.0")
|
16 |
+
proc8=gr.Interface.load("models/dreamlike-art/dreamlike-diffusion-1.0")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
|
19 |
text_gen=gr.Interface.load("spaces/Omnibus/MagicPrompt-Stable-Diffusion")
|
|
|
61 |
|
62 |
prompt=gr.Textbox(label="Prettified Prompt")
|
63 |
run=gr.Button("Launch")
|
64 |
+
|
65 |
+
with gr.Row():
|
66 |
+
seed_input = gr.Textbox(label="Enter Seed Number")
|
67 |
+
|
68 |
+
def send_it1(prompt,seed):
|
69 |
+
torch.manual_seed(int(seed))
|
70 |
+
output1 = proc1(prompt)
|
71 |
+
return output1
|
72 |
+
def send_it2(prompt,seed):
|
73 |
+
torch.manual_seed(int(seed))
|
74 |
+
output2 = proc2(prompt)
|
75 |
+
return output2
|
76 |
+
def send_it1(prompt,seed):
|
77 |
+
torch.manual_seed(int(seed))
|
78 |
+
output1 = proc3(prompt)
|
79 |
+
return output3
|
80 |
+
def send_it2(prompt,seed):
|
81 |
+
torch.manual_seed(int(seed))
|
82 |
+
output2 = proc4(prompt)
|
83 |
+
return output4
|
84 |
+
def send_it1(prompt,seed):
|
85 |
+
torch.manual_seed(int(seed))
|
86 |
+
output1 = proc5(prompt)
|
87 |
+
return output5
|
88 |
+
def send_it2(prompt,seed):
|
89 |
+
torch.manual_seed(int(seed))
|
90 |
+
output2 = proc6(prompt)
|
91 |
+
return output6
|
92 |
+
def send_it1(prompt,seed):
|
93 |
+
torch.manual_seed(int(seed))
|
94 |
+
output1 = proc7(prompt)
|
95 |
+
return output7
|
96 |
+
def send_it2(prompt,seed):
|
97 |
+
torch.manual_seed(int(seed))
|
98 |
+
output2 = proc8(prompt)
|
99 |
+
return output8
|
100 |
+
return output1, output2, output3, output4, output5, output6, output7, output8
|
101 |
+
|
102 |
+
run.click(run_models, inputs=[prompt, seed_input], outputs=[output1, output2, output3, output4, output5, output6, output7, output8])
|
103 |
+
|
104 |
|
105 |
|
106 |
with gr.Row():
|