Spaces:
Sleeping
Sleeping
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -525,8 +525,8 @@ torch.cuda.empty_cache()
|
|
525 |
|
526 |
def upscaler(
|
527 |
input_image: Image.Image,
|
528 |
-
prompt: str = "
|
529 |
-
negative_prompt: str = "
|
530 |
seed: int = random.randint(0, MAX_SEED),
|
531 |
upscale_factor: int = 2,
|
532 |
controlnet_scale: float = 0.6,
|
@@ -535,7 +535,7 @@ def upscaler(
|
|
535 |
tile_width: int = 112,
|
536 |
tile_height: int = 144,
|
537 |
denoise_strength: float = 0.35,
|
538 |
-
num_inference_steps: int =
|
539 |
solver: str = "DDIM",
|
540 |
) -> Image.Image:
|
541 |
|
@@ -634,15 +634,12 @@ def generate_random_string(length):
|
|
634 |
def add_song_cover_text(img,top_title=None,bottom_title=None):
|
635 |
|
636 |
global working
|
637 |
-
global _HEIGHT_
|
638 |
-
global _WIDTH_
|
639 |
|
640 |
if not working:
|
641 |
|
642 |
working = True
|
643 |
|
644 |
-
h =
|
645 |
-
w = _WIDTH_
|
646 |
|
647 |
draw = ImageDraw.Draw(img,mode="RGBA")
|
648 |
|
@@ -1319,9 +1316,9 @@ def handle_generation(h,w,d):
|
|
1319 |
d = d if d == "" else translate(d)
|
1320 |
d = re.sub(r"([ \t]){1,}", " ", d).lower().strip()
|
1321 |
|
1322 |
-
neg = f"Textual, Text,
|
1323 |
q = "\""
|
1324 |
-
pos = f'
|
1325 |
|
1326 |
print(f"""
|
1327 |
Positive: {pos}
|
@@ -1337,7 +1334,7 @@ def handle_generation(h,w,d):
|
|
1337 |
output_type="pil",
|
1338 |
guidance_scale=img_accu,
|
1339 |
num_images_per_prompt=1,
|
1340 |
-
num_inference_steps=
|
1341 |
max_sequence_length=seq,
|
1342 |
generator=torch.Generator(device).manual_seed(random.randint(0, MAX_SEED))
|
1343 |
).images[0]
|
|
|
525 |
|
526 |
def upscaler(
|
527 |
input_image: Image.Image,
|
528 |
+
prompt: str = "Masterpiece, Best Quality, Hyper-Realistic, Super-Realistic.",
|
529 |
+
negative_prompt: str = "Blurry, Shiny, Smooth, Polished, Low Quality, Worst Quality, Normal Quality, Anime Quality, Movies Quality.",
|
530 |
seed: int = random.randint(0, MAX_SEED),
|
531 |
upscale_factor: int = 2,
|
532 |
controlnet_scale: float = 0.6,
|
|
|
535 |
tile_width: int = 112,
|
536 |
tile_height: int = 144,
|
537 |
denoise_strength: float = 0.35,
|
538 |
+
num_inference_steps: int = 30,
|
539 |
solver: str = "DDIM",
|
540 |
) -> Image.Image:
|
541 |
|
|
|
634 |
def add_song_cover_text(img,top_title=None,bottom_title=None):
|
635 |
|
636 |
global working
|
|
|
|
|
637 |
|
638 |
if not working:
|
639 |
|
640 |
working = True
|
641 |
|
642 |
+
w, h = img.size
|
|
|
643 |
|
644 |
draw = ImageDraw.Draw(img,mode="RGBA")
|
645 |
|
|
|
1316 |
d = d if d == "" else translate(d)
|
1317 |
d = re.sub(r"([ \t]){1,}", " ", d).lower().strip()
|
1318 |
|
1319 |
+
neg = f"Textual, Text, Blurry, Shiny, Smooth, Polished, Low Quality, Worst Quality, Normal Quality, Anime Quality, Movies Quality."
|
1320 |
q = "\""
|
1321 |
+
pos = f'Masterpiece, Best Quality, Hyper-Realistic, Super-Realistic{ d if d == "" else ", " + d }'
|
1322 |
|
1323 |
print(f"""
|
1324 |
Positive: {pos}
|
|
|
1334 |
output_type="pil",
|
1335 |
guidance_scale=img_accu,
|
1336 |
num_images_per_prompt=1,
|
1337 |
+
num_inference_steps=30,
|
1338 |
max_sequence_length=seq,
|
1339 |
generator=torch.Generator(device).manual_seed(random.randint(0, MAX_SEED))
|
1340 |
).images[0]
|