prithivMLmods commited on
Commit
51cbb85
·
verified ·
1 Parent(s): 5d344ef

update app

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -94,6 +94,7 @@ pipe.load_lora_weights("prithivMLmods/Monochrome-Pencil", weight_name="Monochrom
94
  pipe.load_lora_weights("prithivMLmods/LZO-1-Preview", weight_name="LZO-1-Preview.safetensors", adapter_name="lzo")
95
  pipe.load_lora_weights("prithivMLmods/Kontext-Watermark-Remover", weight_name="Kontext-Watermark-Remover.safetensors", adapter_name="watermark-remover")
96
  pipe.load_lora_weights("prithivMLmods/Kontext-Unblur-Upscale", weight_name="Kontext-Image-Upscale.safetensors", adapter_name="unblur-upscale")
 
97
 
98
  @spaces.GPU
99
  def infer(input_image, prompt, lora_adapter, seed=42, randomize_seed=False, guidance_scale=2.5, steps=28, progress=gr.Progress(track_tqdm=True)):
@@ -114,6 +115,8 @@ def infer(input_image, prompt, lora_adapter, seed=42, randomize_seed=False, guid
114
  pipe.set_adapters(["watermark-remover"], adapter_weights=[1.0])
115
  elif lora_adapter == "Kontext-Unblur-Upscale":
116
  pipe.set_adapters(["unblur-upscale"], adapter_weights=[1.0])
 
 
117
 
118
  if randomize_seed:
119
  seed = random.randint(0, MAX_SEED)
@@ -210,6 +213,7 @@ with gr.Blocks() as demo:
210
  ["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"],
211
  ["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"],
212
  ["polaroid/1.png", "[photo content], in the style of a vintage Polaroid, with warm, faded tones, and a white border.", "PolaroidWarm"],
 
213
  ["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"],
214
  ["pencil/1.png", "[photo content], replicate the image as a pencil illustration, black and white, with sketch-like detailing.", "MonochromePencil"],
215
  ["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"],
 
94
  pipe.load_lora_weights("prithivMLmods/LZO-1-Preview", weight_name="LZO-1-Preview.safetensors", adapter_name="lzo")
95
  pipe.load_lora_weights("prithivMLmods/Kontext-Watermark-Remover", weight_name="Kontext-Watermark-Remover.safetensors", adapter_name="watermark-remover")
96
  pipe.load_lora_weights("prithivMLmods/Kontext-Unblur-Upscale", weight_name="Kontext-Image-Upscale.safetensors", adapter_name="unblur-upscale")
97
+ pipe.load_lora_weights("prithivMLmods/FLUX.1-Kontext-Dev-Ultra-Realistic-Portrait", weight_name="K-URP_20.safetensors", adapter_name="k-dev")
98
 
99
  @spaces.GPU
100
  def infer(input_image, prompt, lora_adapter, seed=42, randomize_seed=False, guidance_scale=2.5, steps=28, progress=gr.Progress(track_tqdm=True)):
 
115
  pipe.set_adapters(["watermark-remover"], adapter_weights=[1.0])
116
  elif lora_adapter == "Kontext-Unblur-Upscale":
117
  pipe.set_adapters(["unblur-upscale"], adapter_weights=[1.0])
118
+ elif lora_adapter == "Kontext-Dev-Ultra-Realistic-Portrait":
119
+ pipe.set_adapters(["k-dev"], adapter_weights=[1.0])
120
 
121
  if randomize_seed:
122
  seed = random.randint(0, MAX_SEED)
 
213
  ["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"],
214
  ["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"],
215
  ["polaroid/1.png", "[photo content], in the style of a vintage Polaroid, with warm, faded tones, and a white border.", "PolaroidWarm"],
216
+ ["K-URP/1.jpg", "ultra-realistic portrait.", "Kontext-Dev-Ultra-Realistic-Portrait"],
217
  ["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"],
218
  ["pencil/1.png", "[photo content], replicate the image as a pencil illustration, black and white, with sketch-like detailing.", "MonochromePencil"],
219
  ["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"],