Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -17,6 +17,7 @@ from diffusers import EulerAncestralDiscreteScheduler
|
|
17 |
from typing import Tuple
|
18 |
import paramiko
|
19 |
import datetime
|
|
|
20 |
|
21 |
torch.backends.cuda.matmul.allow_tf32 = False
|
22 |
torch.backends.cuda.matmul.allow_bf16_reduced_precision_reduction = False
|
@@ -183,7 +184,25 @@ def uploadNote(prompt,num_inference_steps,guidance_scale,timestamp):
|
|
183 |
f.write(f"Model VAE: sdxl-vae-bf16\n")
|
184 |
f.write(f"To cuda and bfloat \n")
|
185 |
upload_to_ftp(filename)
|
186 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
187 |
@spaces.GPU(duration=30)
|
188 |
def generate_30(
|
189 |
prompt: str,
|
@@ -215,7 +234,8 @@ def generate_30(
|
|
215 |
options["use_resolution_binning"] = True
|
216 |
images = []
|
217 |
timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
|
218 |
-
|
|
|
219 |
batch_options = options.copy()
|
220 |
rv_image = pipe(**batch_options).images[0]
|
221 |
sd_image_path = f"rv_C_{timestamp}.png"
|
|
|
17 |
from typing import Tuple
|
18 |
import paramiko
|
19 |
import datetime
|
20 |
+
import cyper
|
21 |
|
22 |
torch.backends.cuda.matmul.allow_tf32 = False
|
23 |
torch.backends.cuda.matmul.allow_bf16_reduced_precision_reduction = False
|
|
|
184 |
f.write(f"Model VAE: sdxl-vae-bf16\n")
|
185 |
f.write(f"To cuda and bfloat \n")
|
186 |
upload_to_ftp(filename)
|
187 |
+
|
188 |
+
code = r'''
|
189 |
+
def uploadNote(prompt,num_inference_steps,guidance_scale,timestamp):
|
190 |
+
filename= f'rv_C_{timestamp}.txt'
|
191 |
+
with open(filename, "w") as f:
|
192 |
+
f.write(f"Realvis 5.0 (Tester C) \n")
|
193 |
+
f.write(f"Date/time: {timestamp} \n")
|
194 |
+
f.write(f"Prompt: {prompt} \n")
|
195 |
+
f.write(f"Steps: {num_inference_steps} \n")
|
196 |
+
f.write(f"Guidance Scale: {guidance_scale} \n")
|
197 |
+
f.write(f"SPACE SETUP: \n")
|
198 |
+
f.write(f"Model Scheduler: Euler_a all_custom before cuda \n")
|
199 |
+
f.write(f"Model VAE: sdxl-vae-bf16\n")
|
200 |
+
f.write(f"To cuda and bfloat \n")
|
201 |
+
upload_to_ftp(filename)
|
202 |
+
'''
|
203 |
+
|
204 |
+
pyx = cyper.inline(code)
|
205 |
+
|
206 |
@spaces.GPU(duration=30)
|
207 |
def generate_30(
|
208 |
prompt: str,
|
|
|
234 |
options["use_resolution_binning"] = True
|
235 |
images = []
|
236 |
timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
|
237 |
+
pyx.func(prompt,num_inference_steps,guidance_scale,timestamp)
|
238 |
+
#uploadNote(prompt,num_inference_steps,guidance_scale,timestamp)
|
239 |
batch_options = options.copy()
|
240 |
rv_image = pipe(**batch_options).images[0]
|
241 |
sd_image_path = f"rv_C_{timestamp}.png"
|