Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -35,6 +35,9 @@ pipe.load_lora_weights("prithivMLmods/PhotoCleanser-i2i", weight_name="PhotoClea
|
|
| 35 |
pipe.load_lora_weights("prithivMLmods/Photo-Restore-i2i", weight_name="Photo-Restore-i2i.safetensors", adapter_name="restorer")
|
| 36 |
pipe.load_lora_weights("prithivMLmods/Polaroid-Warm-i2i", weight_name="Polaroid-Warm-i2i.safetensors", adapter_name="polaroid")
|
| 37 |
pipe.load_lora_weights("prithivMLmods/Monochrome-Pencil", weight_name="Monochrome-Pencil-i2i.safetensors", adapter_name="pencil")
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
# --- Upscaler Model Initialization ---
|
| 40 |
aura_sr = AuraSR.from_pretrained("fal/AuraSR-v2")
|
|
@@ -61,6 +64,10 @@ def infer(input_image, prompt, lora_adapter, upscale_image, seed=42, randomize_s
|
|
| 61 |
pipe.set_adapters(["polaroid"], adapter_weights=[1.0])
|
| 62 |
elif lora_adapter == "MonochromePencil":
|
| 63 |
pipe.set_adapters(["pencil"], adapter_weights=[1.0])
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
|
| 65 |
if randomize_seed:
|
| 66 |
seed = random.randint(0, MAX_SEED)
|
|
@@ -158,7 +165,7 @@ with gr.Blocks(css=css, theme="bethecloud/storj_theme") as demo:
|
|
| 158 |
with gr.Row():
|
| 159 |
lora_adapter = gr.Dropdown(
|
| 160 |
label="Chosen LoRA",
|
| 161 |
-
choices=["PhotoCleanser", "PhotoRestorer", "PolaroidWarm", "MonochromePencil"],
|
| 162 |
value="PhotoCleanser"
|
| 163 |
)
|
| 164 |
|
|
@@ -171,9 +178,12 @@ with gr.Blocks(css=css, theme="bethecloud/storj_theme") as demo:
|
|
| 171 |
["photocleanser/2.png", "[photo content], remove the cat from the image while preserving the background and remaining elements, maintaining realism and original details.", "PhotoCleanser"],
|
| 172 |
["photocleanser/1.png", "[photo content], remove the football from the image while preserving the background and remaining elements, maintaining realism and original details.", "PhotoCleanser"],
|
| 173 |
["photorestore/1.png", "[photo content], restore and enhance the image by repairing any damage, scratches, or fading. Colorize the photo naturally while preserving authentic textures and details, maintaining a realistic and historically accurate look.", "PhotoRestorer"],
|
|
|
|
|
|
|
| 174 |
["photorestore/2.png", "[photo content], restore and enhance the image by repairing any damage, scratches, or fading. Colorize the photo naturally while preserving authentic textures and details, maintaining a realistic and historically accurate look.", "PhotoRestorer"],
|
| 175 |
["polaroid/1.png", "[photo content], in the style of a vintage Polaroid, with warm, faded tones, and a white border.", "PolaroidWarm"],
|
| 176 |
["pencil/1.png", "[photo content], replicate the image as a pencil illustration, black and white, with sketch-like detailing.", "MonochromePencil"],
|
|
|
|
| 177 |
],
|
| 178 |
inputs=[input_image, prompt, lora_adapter],
|
| 179 |
# The output now targets the ImageSlider component
|
|
|
|
| 35 |
pipe.load_lora_weights("prithivMLmods/Photo-Restore-i2i", weight_name="Photo-Restore-i2i.safetensors", adapter_name="restorer")
|
| 36 |
pipe.load_lora_weights("prithivMLmods/Polaroid-Warm-i2i", weight_name="Polaroid-Warm-i2i.safetensors", adapter_name="polaroid")
|
| 37 |
pipe.load_lora_weights("prithivMLmods/Monochrome-Pencil", weight_name="Monochrome-Pencil-i2i.safetensors", adapter_name="pencil")
|
| 38 |
+
# Add the new LZO adapter
|
| 39 |
+
pipe.load_lora_weights("prithivMLmods/LZO-1-Preview", weight_name="LZO-1-Preview.safetensors", adapter_name="lzo")
|
| 40 |
+
|
| 41 |
|
| 42 |
# --- Upscaler Model Initialization ---
|
| 43 |
aura_sr = AuraSR.from_pretrained("fal/AuraSR-v2")
|
|
|
|
| 64 |
pipe.set_adapters(["polaroid"], adapter_weights=[1.0])
|
| 65 |
elif lora_adapter == "MonochromePencil":
|
| 66 |
pipe.set_adapters(["pencil"], adapter_weights=[1.0])
|
| 67 |
+
# Add the new LZO adapter condition
|
| 68 |
+
elif lora_adapter == "LZO-Zoom":
|
| 69 |
+
pipe.set_adapters(["lzo"], adapter_weights=[1.0])
|
| 70 |
+
|
| 71 |
|
| 72 |
if randomize_seed:
|
| 73 |
seed = random.randint(0, MAX_SEED)
|
|
|
|
| 165 |
with gr.Row():
|
| 166 |
lora_adapter = gr.Dropdown(
|
| 167 |
label="Chosen LoRA",
|
| 168 |
+
choices=["PhotoCleanser", "PhotoRestorer", "PolaroidWarm", "MonochromePencil", "LZO-Zoom"],
|
| 169 |
value="PhotoCleanser"
|
| 170 |
)
|
| 171 |
|
|
|
|
| 178 |
["photocleanser/2.png", "[photo content], remove the cat from the image while preserving the background and remaining elements, maintaining realism and original details.", "PhotoCleanser"],
|
| 179 |
["photocleanser/1.png", "[photo content], remove the football from the image while preserving the background and remaining elements, maintaining realism and original details.", "PhotoCleanser"],
|
| 180 |
["photorestore/1.png", "[photo content], restore and enhance the image by repairing any damage, scratches, or fading. Colorize the photo naturally while preserving authentic textures and details, maintaining a realistic and historically accurate look.", "PhotoRestorer"],
|
| 181 |
+
# Add the new LZO example
|
| 182 |
+
["lzo/1.jpg", "[photo content], zoom in on the specified [face close-up], enhancing resolution and detail while preserving sharpness, realism, and original context. Maintain natural proportions and background continuity around the zoomed area.", "LZO-Zoom"],
|
| 183 |
["photorestore/2.png", "[photo content], restore and enhance the image by repairing any damage, scratches, or fading. Colorize the photo naturally while preserving authentic textures and details, maintaining a realistic and historically accurate look.", "PhotoRestorer"],
|
| 184 |
["polaroid/1.png", "[photo content], in the style of a vintage Polaroid, with warm, faded tones, and a white border.", "PolaroidWarm"],
|
| 185 |
["pencil/1.png", "[photo content], replicate the image as a pencil illustration, black and white, with sketch-like detailing.", "MonochromePencil"],
|
| 186 |
+
|
| 187 |
],
|
| 188 |
inputs=[input_image, prompt, lora_adapter],
|
| 189 |
# The output now targets the ImageSlider component
|