Spaces:
Sleeping
Sleeping
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -429,13 +429,12 @@ root.addHandler(handler)
|
|
| 429 |
# constant data
|
| 430 |
|
| 431 |
base = "black-forest-labs/FLUX.1-schnell"
|
| 432 |
-
pegasus_name = "google/pegasus-xsum"
|
| 433 |
|
| 434 |
# precision data
|
| 435 |
|
| 436 |
seq=256
|
| 437 |
-
width=
|
| 438 |
-
height=
|
| 439 |
image_steps=8
|
| 440 |
img_accu=0
|
| 441 |
|
|
@@ -509,7 +508,7 @@ def upscaler(
|
|
| 509 |
prompt: str = "Photorealistic, Hyperrealistic, Realistic Photography, High-Quality Photography, Natural.",
|
| 510 |
negative_prompt: str = "Distorted, Discontinuous, Blurry, Doll-Like, Overly-Plastic, Low-Quality, Painted, Smoothed, Artificial, Phony, Gaudy, Digital Effects.",
|
| 511 |
seed: int = int(str(random.random()).split(".")[1]),
|
| 512 |
-
upscale_factor: int =
|
| 513 |
controlnet_scale: float = 0.6,
|
| 514 |
controlnet_decay: float = 1.0,
|
| 515 |
condition_scale: int = 6,
|
|
@@ -539,7 +538,7 @@ def upscaler(
|
|
| 539 |
tile_size=(tile_height, tile_width),
|
| 540 |
denoise_strength=denoise_strength,
|
| 541 |
num_inference_steps=num_inference_steps,
|
| 542 |
-
loras_scale={"more_details":
|
| 543 |
solver_type=solver_type,
|
| 544 |
)
|
| 545 |
|
|
@@ -548,11 +547,11 @@ def upscaler(
|
|
| 548 |
return enhanced_image
|
| 549 |
|
| 550 |
def summarize_text(
|
| 551 |
-
text, max_length=
|
| 552 |
):
|
| 553 |
log(f'CALL summarize_text')
|
| 554 |
-
summ = pipeline("summarization", model="
|
| 555 |
-
summary = summ("summarize: " + text)[0]["summary_text"]
|
| 556 |
log(f'RET summarize_text with summary as {summary}')
|
| 557 |
return summary
|
| 558 |
|
|
|
|
| 429 |
# constant data
|
| 430 |
|
| 431 |
base = "black-forest-labs/FLUX.1-schnell"
|
|
|
|
| 432 |
|
| 433 |
# precision data
|
| 434 |
|
| 435 |
seq=256
|
| 436 |
+
width=1536
|
| 437 |
+
height=1536
|
| 438 |
image_steps=8
|
| 439 |
img_accu=0
|
| 440 |
|
|
|
|
| 508 |
prompt: str = "Photorealistic, Hyperrealistic, Realistic Photography, High-Quality Photography, Natural.",
|
| 509 |
negative_prompt: str = "Distorted, Discontinuous, Blurry, Doll-Like, Overly-Plastic, Low-Quality, Painted, Smoothed, Artificial, Phony, Gaudy, Digital Effects.",
|
| 510 |
seed: int = int(str(random.random()).split(".")[1]),
|
| 511 |
+
upscale_factor: int = 4,
|
| 512 |
controlnet_scale: float = 0.6,
|
| 513 |
controlnet_decay: float = 1.0,
|
| 514 |
condition_scale: int = 6,
|
|
|
|
| 538 |
tile_size=(tile_height, tile_width),
|
| 539 |
denoise_strength=denoise_strength,
|
| 540 |
num_inference_steps=num_inference_steps,
|
| 541 |
+
loras_scale={"more_details": 0.5, "sdxl_render": 1.0},
|
| 542 |
solver_type=solver_type,
|
| 543 |
)
|
| 544 |
|
|
|
|
| 547 |
return enhanced_image
|
| 548 |
|
| 549 |
def summarize_text(
|
| 550 |
+
text, min_length=4, max_length=12
|
| 551 |
):
|
| 552 |
log(f'CALL summarize_text')
|
| 553 |
+
summ = pipeline("summarization", model="facebook/bart-large-cnn")
|
| 554 |
+
summary = summ("summarize: " + text, max_length=max_length, min_length=min_length, do_sample=False)[0]["summary_text"]
|
| 555 |
log(f'RET summarize_text with summary as {summary}')
|
| 556 |
return summary
|
| 557 |
|