Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,7 @@ import os
|
|
4 |
import logging
|
5 |
from PIL import Image
|
6 |
import io
|
|
|
7 |
|
8 |
# 로깅 설정
|
9 |
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
@@ -15,6 +16,8 @@ api_client = Client("http://211.233.58.202:7960/")
|
|
15 |
# Webhook URL
|
16 |
WEBHOOK_URL = "https://connect.pabbly.com/workflow/sendwebhookdata/IjU3NjUwNTY0MDYzMTA0MzE1MjZlNTUzYzUxM2Ei_pc"
|
17 |
|
|
|
|
|
18 |
def generate_image(prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps):
|
19 |
logger.info(f"Received message: {prompt}, seed: {seed}, randomize_seed: {randomize_seed}, "
|
20 |
f"width: {width}, height: {height}, guidance_scale: {guidance_scale}, "
|
@@ -55,6 +58,8 @@ def generate_image(prompt, seed, randomize_seed, width, height, guidance_scale,
|
|
55 |
logger.error("Error during API request: %s", str(e), exc_info=True)
|
56 |
return "Failed to generate image due to an error."
|
57 |
|
|
|
|
|
58 |
def send_to_webhook(prompt, image_url):
|
59 |
payload = {
|
60 |
"prompt": prompt,
|
|
|
4 |
import logging
|
5 |
from PIL import Image
|
6 |
import io
|
7 |
+
import requests # 이 줄을 추가합니다
|
8 |
|
9 |
# 로깅 설정
|
10 |
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
|
|
16 |
# Webhook URL
|
17 |
WEBHOOK_URL = "https://connect.pabbly.com/workflow/sendwebhookdata/IjU3NjUwNTY0MDYzMTA0MzE1MjZlNTUzYzUxM2Ei_pc"
|
18 |
|
19 |
+
|
20 |
+
|
21 |
def generate_image(prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps):
|
22 |
logger.info(f"Received message: {prompt}, seed: {seed}, randomize_seed: {randomize_seed}, "
|
23 |
f"width: {width}, height: {height}, guidance_scale: {guidance_scale}, "
|
|
|
58 |
logger.error("Error during API request: %s", str(e), exc_info=True)
|
59 |
return "Failed to generate image due to an error."
|
60 |
|
61 |
+
|
62 |
+
|
63 |
def send_to_webhook(prompt, image_url):
|
64 |
payload = {
|
65 |
"prompt": prompt,
|