prithivMLmods commited on
Commit
a04857b
·
verified ·
1 Parent(s): 8aeb540

update app

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -38,6 +38,7 @@ pipe.load_lora_weights("prithivMLmods/Polaroid-Warm-i2i", weight_name="Polaroid-
38
  pipe.load_lora_weights("prithivMLmods/Monochrome-Pencil", weight_name="Monochrome-Pencil-i2i.safetensors", adapter_name="pencil")
39
  pipe.load_lora_weights("prithivMLmods/LZO-1-Preview", weight_name="LZO-1-Preview.safetensors", adapter_name="lzo")
40
  pipe.load_lora_weights("prithivMLmods/Kontext-Watermark-Remover", weight_name="Kontext-Watermark-Remover.safetensors", adapter_name="watermark-remover")
 
41
 
42
  # --- Upscaler Model Initialization ---
43
  aura_sr = AuraSR.from_pretrained("fal/AuraSR-v2")
@@ -62,6 +63,8 @@ def infer(input_image, prompt, lora_adapter, upscale_image, seed=42, randomize_s
62
  pipe.set_adapters(["lzo"], adapter_weights=[1.0])
63
  elif lora_adapter == "Kontext-Watermark-Remover":
64
  pipe.set_adapters(["watermark-remover"], adapter_weights=[1.0])
 
 
65
 
66
  if randomize_seed:
67
  seed = random.randint(0, MAX_SEED)
@@ -100,7 +103,7 @@ css="""
100
  #main-title h1 {font-size: 2.1em !important;}
101
  """
102
 
103
- with gr.Blocks(css=css, theme="bethecloud/storj_theme") as demo:
104
 
105
  with gr.Column(elem_id="col-container"):
106
  gr.Markdown("# **Photo-Mate-i2i**", elem_id="main-title")
@@ -153,7 +156,7 @@ with gr.Blocks(css=css, theme="bethecloud/storj_theme") as demo:
153
  with gr.Row():
154
  lora_adapter = gr.Dropdown(
155
  label="Chosen LoRA",
156
- choices=["PhotoCleanser", "PhotoRestorer", "PolaroidWarm", "MonochromePencil", "LZO-Zoom", "Kontext-Watermark-Remover"],
157
  value="PhotoCleanser"
158
  )
159
 
@@ -169,7 +172,11 @@ with gr.Blocks(css=css, theme="bethecloud/storj_theme") as demo:
169
  ["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"],
170
  ["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"],
171
  ["polaroid/1.png", "[photo content], in the style of a vintage Polaroid, with warm, faded tones, and a white border.", "PolaroidWarm"],
 
172
  ["pencil/1.png", "[photo content], replicate the image as a pencil illustration, black and white, with sketch-like detailing.", "MonochromePencil"],
 
 
 
173
  ],
174
  inputs=[input_image, prompt, lora_adapter],
175
  outputs=[output_slider, seed],
 
38
  pipe.load_lora_weights("prithivMLmods/Monochrome-Pencil", weight_name="Monochrome-Pencil-i2i.safetensors", adapter_name="pencil")
39
  pipe.load_lora_weights("prithivMLmods/LZO-1-Preview", weight_name="LZO-1-Preview.safetensors", adapter_name="lzo")
40
  pipe.load_lora_weights("prithivMLmods/Kontext-Watermark-Remover", weight_name="Kontext-Watermark-Remover.safetensors", adapter_name="watermark-remover")
41
+ pipe.load_lora_weights("prithivMLmods/Kontext-Unblur-Upscale", weight_name="Kontext-Image-Upscale.safetensors", adapter_name="unblur-upscale")
42
 
43
  # --- Upscaler Model Initialization ---
44
  aura_sr = AuraSR.from_pretrained("fal/AuraSR-v2")
 
63
  pipe.set_adapters(["lzo"], adapter_weights=[1.0])
64
  elif lora_adapter == "Kontext-Watermark-Remover":
65
  pipe.set_adapters(["watermark-remover"], adapter_weights=[1.0])
66
+ elif lora_adapter == "Kontext-Unblur-Upscale":
67
+ pipe.set_adapters(["unblur-upscale"], adapter_weights=[1.0])
68
 
69
  if randomize_seed:
70
  seed = random.randint(0, MAX_SEED)
 
103
  #main-title h1 {font-size: 2.1em !important;}
104
  """
105
 
106
+ with gr.Blocks(css=css, theme="allenai/gradio-theme") as demo:
107
 
108
  with gr.Column(elem_id="col-container"):
109
  gr.Markdown("# **Photo-Mate-i2i**", elem_id="main-title")
 
156
  with gr.Row():
157
  lora_adapter = gr.Dropdown(
158
  label="Chosen LoRA",
159
+ choices=["PhotoCleanser", "PhotoRestorer", "PolaroidWarm", "MonochromePencil", "LZO-Zoom", "Kontext-Watermark-Remover", "Kontext-Unblur-Upscale"],
160
  value="PhotoCleanser"
161
  )
162
 
 
172
  ["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"],
173
  ["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"],
174
  ["polaroid/1.png", "[photo content], in the style of a vintage Polaroid, with warm, faded tones, and a white border.", "PolaroidWarm"],
175
+ ["unblur/1.jpg", "[photo content], upscale the low-quality image to 4K resolution, enhancing sharpness, clarity, and fine details while preserving the original texture, colors, lighting, and natural appearance. Remove noise, blur, and compression artifacts without over-smoothing or distorting facial or object features. Ensure realistic depth, balanced contrast, and accurate tones, achieving a high-definition, lifelike result that maintains the integrity of the original image.", "Kontext-Unblur-Upscale"],
176
  ["pencil/1.png", "[photo content], replicate the image as a pencil illustration, black and white, with sketch-like detailing.", "MonochromePencil"],
177
+ ["unblur/11.jpg", "[photo content], upscale the low-quality image to 4K resolution, enhancing sharpness, clarity, and fine details while preserving the original texture, colors, lighting, and natural appearance. Remove noise, blur, and compression artifacts without over-smoothing or distorting facial or object features. Ensure realistic depth, balanced contrast, and accurate tones, achieving a high-definition, lifelike result that maintains the integrity of the original image.", "Kontext-Unblur-Upscale"],
178
+
179
+
180
  ],
181
  inputs=[input_image, prompt, lora_adapter],
182
  outputs=[output_slider, seed],