salomonsky commited on
Commit
c5b40c9
·
verified ·
1 Parent(s): 11a4797

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -14,6 +14,7 @@ from gradio_imageslider import ImageSlider
14
 
15
  translator = Translator()
16
  HF_TOKEN = os.environ.get("HF_TOKEN")
 
17
  MAX_SEED = np.iinfo(np.int32).max
18
  CSS = "footer { visibility: hidden; }"
19
  JS = "function () { gradioURL = window.location.href; if (!gradioURL.endsWith('?__theme=dark')) { window.location.replace(gradioURL + '?__theme=dark'); } }"
@@ -44,7 +45,7 @@ async def gen(prompt, basemodel, width, height, scales, steps, seed, upscale_fac
44
  return [image_path, upscale_image]
45
 
46
  def get_upscale_finegrain(prompt, img_path, upscale_factor):
47
- client = Client("finegrain/finegrain-image-enhancer", hf_token=HF_TOKEN)
48
  result = client.predict(input_image=handle_file(img_path), prompt=prompt, negative_prompt="", seed=42, upscale_factor=upscale_factor, controlnet_scale=0.6, controlnet_decay=1, condition_scale=6, tile_width=112, tile_height=144, denoise_strength=0.35, num_inference_steps=18, solver="DDIM", api_name="/process")
49
  return result[1]
50
 
 
14
 
15
  translator = Translator()
16
  HF_TOKEN = os.environ.get("HF_TOKEN")
17
+ HF_TOKEN_UPSCALER = os.environ.get("HF_TOKEN_UPSCALER")
18
  MAX_SEED = np.iinfo(np.int32).max
19
  CSS = "footer { visibility: hidden; }"
20
  JS = "function () { gradioURL = window.location.href; if (!gradioURL.endsWith('?__theme=dark')) { window.location.replace(gradioURL + '?__theme=dark'); } }"
 
45
  return [image_path, upscale_image]
46
 
47
  def get_upscale_finegrain(prompt, img_path, upscale_factor):
48
+ client = Client("finegrain/finegrain-image-enhancer", hf_token=HF_TOKEN_UPSCALER)
49
  result = client.predict(input_image=handle_file(img_path), prompt=prompt, negative_prompt="", seed=42, upscale_factor=upscale_factor, controlnet_scale=0.6, controlnet_decay=1, condition_scale=6, tile_width=112, tile_height=144, denoise_strength=0.35, num_inference_steps=18, solver="DDIM", api_name="/process")
50
  return result[1]
51