AlGe commited on
Commit
f702f00
·
verified ·
1 Parent(s): 8dc3fdd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -43
app.py CHANGED
@@ -1,45 +1,4 @@
1
- from flask import Flask, request, jsonify
2
  from gradio_client import Client
3
  import gradio as gr
4
-
5
- app = Flask(__name__)
6
-
7
- client = Client("radames/Enhance-This-HiDiffusion-SDXL")
8
-
9
- @app.route('/predict', methods=['POST'])
10
- def my_interface():
11
- data = request.get_json()
12
-
13
- input_image = data['input_image']
14
- prompt = data.get('prompt', "This is a beautiful scenery")
15
- negative_prompt = data.get('negative_prompt', "blurry, ugly, duplicate, poorly drawn, deformed, mosaic")
16
- seed = data.get('seed', 1415926535897932)
17
- guidance_scale = data.get('guidance_scale', 8.5)
18
- scale = data.get('scale', 2)
19
- controlnet_conditioning_scale = data.get('controlnet_conditioning_scale', 0.5)
20
- strength = data.get('strength', 1.0)
21
- controlnet_start = data.get('controlnet_start', 0.0)
22
- controlnet_end = data.get('controlnet_end', 1.0)
23
- guassian_sigma = data.get('guassian_sigma', 2.0)
24
- intensity_threshold = data.get('intensity_threshold', 3)
25
-
26
- result = client.predict(
27
- input_image=input_image,
28
- prompt=prompt,
29
- negative_prompt=negative_prompt,
30
- seed=seed,
31
- guidance_scale=guidance_scale,
32
- scale=scale,
33
- controlnet_conditioning_scale=controlnet_conditioning_scale,
34
- strength=strength,
35
- controlnet_start=controlnet_start,
36
- controlnet_end=controlnet_end,
37
- guassian_sigma=guassian_sigma,
38
- intensity_threshold=intensity_threshold,
39
- api_name="/predict"
40
- )
41
-
42
- return jsonify(result[0][0])
43
-
44
- if __name__ == '__main__':
45
- app.run(debug=True)
 
1
+
2
  from gradio_client import Client
3
  import gradio as gr
4
+ iface = gr.load("spaces/radames/Enhance-This-HiDiffusion-SDXL)