Prakh24s commited on
Commit
e0289b1
·
verified ·
1 Parent(s): 4823cba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -10
app.py CHANGED
@@ -35,12 +35,17 @@ def style_transfer(input_image_path, style_image_path, prompt_det):
35
  "seed": 42,
36
  "guidance_scale": 5
37
  }
38
- output = replicate.run(
39
- # "prakharsaxena24/2d-to-real-style:c0e1e612a11a13d1d57a6d647e7665ad850bc73715337c1f499bb7b52404c35a",
40
- "prakharsaxena24/2d-to-real-style:fef4d74fb7d11df35aa4bbdf3d8671b4d0352464dc67b169968393c657ab6038",
41
- input=input
 
 
 
 
42
  )
43
- return output[0]
 
44
 
45
  def upscale_image(image_path, prompt_det):
46
  input = {
@@ -50,12 +55,18 @@ def upscale_image(image_path, prompt_det):
50
  "negative_prompt": "hands, fingers, feet, legs, shoes",
51
 
52
  }
53
- output = replicate.run(
54
- "philz1337x/clarity-upscaler:eba39f520856d5e61a8ad56fd57f97be2fa30de65e29d8e94db5209a1827cd59",
55
- # "prakharsaxena24/calrity-upscaler-private",
56
- input=input)
57
 
58
- return output[0]
 
 
 
 
 
 
59
 
60
  def get_keyword_prompt(image_url):
61
  client = OpenAI()
 
35
  "seed": 42,
36
  "guidance_scale": 5
37
  }
38
+ # output = replicate.run(
39
+ # # "prakharsaxena24/2d-to-real-style:fef4d74fb7d11df35aa4bbdf3d8671b4d0352464dc67b169968393c657ab6038",
40
+ # input=input
41
+ # )
42
+ # return output[0]
43
+ deployment = replicate.deployments.get("2clicksmedia/my-app-photorealism")
44
+ prediction = deployment.predictions.create(
45
+ input=input
46
  )
47
+ prediction.wait()
48
+ return prediction.output[0]
49
 
50
  def upscale_image(image_path, prompt_det):
51
  input = {
 
55
  "negative_prompt": "hands, fingers, feet, legs, shoes",
56
 
57
  }
58
+ # output = replicate.run(
59
+ # "philz1337x/clarity-upscaler:eba39f520856d5e61a8ad56fd57f97be2fa30de65e29d8e94db5209a1827cd59",
60
+ # # "prakharsaxena24/calrity-upscaler-private",
61
+ # input=input)
62
 
63
+ # return output[0]
64
+ deployment = replicate.deployments.get("2clicksmedia/upscaler")
65
+ prediction = deployment.predictions.create(
66
+ input={"image": "..."}
67
+ )
68
+ prediction.wait()
69
+ return prediction.output[0]
70
 
71
  def get_keyword_prompt(image_url):
72
  client = OpenAI()