Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -170,7 +170,7 @@ def upload_to_ftp(filename):
|
|
| 170 |
def uploadNote(prompt,num_inference_steps,guidance_scale,timestamp):
|
| 171 |
filename= f'rv_C_{timestamp}.txt'
|
| 172 |
with open(filename, "w") as f:
|
| 173 |
-
f.write(f"Realvis 5.0 (Tester
|
| 174 |
f.write(f"Date/time: {timestamp} \n")
|
| 175 |
f.write(f"Prompt: {prompt} \n")
|
| 176 |
f.write(f"Steps: {num_inference_steps} \n")
|
|
@@ -284,9 +284,8 @@ def generate_30(
|
|
| 284 |
timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
|
| 285 |
filename = pyx.uploadNote(prompt,num_inference_steps,guidance_scale,timestamp)
|
| 286 |
#upload_to_ftp(filename)
|
| 287 |
-
pyx.upload_to_ftp(filename)
|
| 288 |
#uploadNote(prompt,num_inference_steps,guidance_scale,timestamp)
|
| 289 |
-
|
| 290 |
if denoising_start==0.0:
|
| 291 |
options = {
|
| 292 |
"prompt": [prompt],
|
|
@@ -355,6 +354,7 @@ def generate_30(
|
|
| 355 |
torch.save(rv_image, sd_latent_path)
|
| 356 |
|
| 357 |
if denoising_end==1.0 and denoising_start!=0.0:
|
|
|
|
| 358 |
latent_file = f'rv_L_{denoising_start}.l'
|
| 359 |
loaded_latent = torch.load(latent_file)
|
| 360 |
print("Shape of loaded latent:", loaded_latent.shape)
|
|
@@ -423,7 +423,6 @@ def generate_30(
|
|
| 423 |
options["use_resolution_binning"] = True
|
| 424 |
batch_options = options.copy()
|
| 425 |
rv_image = pipe(**batch_options).images[0]
|
| 426 |
-
sd_image_path = f"rv_L_{timestamp}.png"
|
| 427 |
rv_image.save(sd_image_path,optimize=False,compress_level=0)
|
| 428 |
pyx.upload_to_ftp(sd_image_path)
|
| 429 |
torch.set_float32_matmul_precision("medium")
|
|
@@ -433,7 +432,6 @@ def generate_30(
|
|
| 433 |
downscale_path = f"rv_L_upscale_{timestamp}.png"
|
| 434 |
downscale1.save(downscale_path,optimize=False,compress_level=0)
|
| 435 |
pyx.upload_to_ftp(downscale_path)
|
| 436 |
-
|
| 437 |
unique_name = str(uuid.uuid4()) + ".png"
|
| 438 |
os.symlink(sd_image_path, unique_name)
|
| 439 |
return [unique_name]
|
|
|
|
| 170 |
def uploadNote(prompt,num_inference_steps,guidance_scale,timestamp):
|
| 171 |
filename= f'rv_C_{timestamp}.txt'
|
| 172 |
with open(filename, "w") as f:
|
| 173 |
+
f.write(f"Realvis 5.0 (Tester L) \n")
|
| 174 |
f.write(f"Date/time: {timestamp} \n")
|
| 175 |
f.write(f"Prompt: {prompt} \n")
|
| 176 |
f.write(f"Steps: {num_inference_steps} \n")
|
|
|
|
| 284 |
timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
|
| 285 |
filename = pyx.uploadNote(prompt,num_inference_steps,guidance_scale,timestamp)
|
| 286 |
#upload_to_ftp(filename)
|
|
|
|
| 287 |
#uploadNote(prompt,num_inference_steps,guidance_scale,timestamp)
|
| 288 |
+
sd_image_path = f"rv_L_{timestamp}.png"
|
| 289 |
if denoising_start==0.0:
|
| 290 |
options = {
|
| 291 |
"prompt": [prompt],
|
|
|
|
| 354 |
torch.save(rv_image, sd_latent_path)
|
| 355 |
|
| 356 |
if denoising_end==1.0 and denoising_start!=0.0:
|
| 357 |
+
pyx.upload_to_ftp(filename)
|
| 358 |
latent_file = f'rv_L_{denoising_start}.l'
|
| 359 |
loaded_latent = torch.load(latent_file)
|
| 360 |
print("Shape of loaded latent:", loaded_latent.shape)
|
|
|
|
| 423 |
options["use_resolution_binning"] = True
|
| 424 |
batch_options = options.copy()
|
| 425 |
rv_image = pipe(**batch_options).images[0]
|
|
|
|
| 426 |
rv_image.save(sd_image_path,optimize=False,compress_level=0)
|
| 427 |
pyx.upload_to_ftp(sd_image_path)
|
| 428 |
torch.set_float32_matmul_precision("medium")
|
|
|
|
| 432 |
downscale_path = f"rv_L_upscale_{timestamp}.png"
|
| 433 |
downscale1.save(downscale_path,optimize=False,compress_level=0)
|
| 434 |
pyx.upload_to_ftp(downscale_path)
|
|
|
|
| 435 |
unique_name = str(uuid.uuid4()) + ".png"
|
| 436 |
os.symlink(sd_image_path, unique_name)
|
| 437 |
return [unique_name]
|