Spaces:
Sleeping
Sleeping
Commit ·
5d123f9
1
Parent(s): 5f0e6f8
Update main.py
Browse files
main.py
CHANGED
|
@@ -11,7 +11,7 @@ from stability_sdk import client
|
|
| 11 |
import stability_sdk.interfaces.gooseai.generation.generation_pb2 as generation
|
| 12 |
import replicate
|
| 13 |
|
| 14 |
-
def generate_and_upscale_image(text_prompt, clipdrop_api_key, stability_api_key, replicate_api_token):
|
| 15 |
|
| 16 |
headers = {'x-api-key': clipdrop_api_key}
|
| 17 |
body_params = {'prompt': (None, text_prompt, 'text/plain')}
|
|
@@ -69,6 +69,4 @@ def generate_and_upscale_image(text_prompt, clipdrop_api_key, stability_api_key,
|
|
| 69 |
|
| 70 |
response = requests.get(output)
|
| 71 |
final_img = Image.open(io.BytesIO(response.content))
|
| 72 |
-
final_img.save("gfpgan_upscaled_image.png")
|
| 73 |
-
|
| 74 |
-
return final_img
|
|
|
|
| 11 |
import stability_sdk.interfaces.gooseai.generation.generation_pb2 as generation
|
| 12 |
import replicate
|
| 13 |
|
| 14 |
+
def generate_and_upscale_image(text_prompt, clipdrop_api_key, stability_api_key, replicate_api_token, download_path):
|
| 15 |
|
| 16 |
headers = {'x-api-key': clipdrop_api_key}
|
| 17 |
body_params = {'prompt': (None, text_prompt, 'text/plain')}
|
|
|
|
| 69 |
|
| 70 |
response = requests.get(output)
|
| 71 |
final_img = Image.open(io.BytesIO(response.content))
|
| 72 |
+
final_img.save(os.path.join(download_path, "gfpgan_upscaled_image.png"))
|
|
|
|
|
|