Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -19,7 +19,7 @@ cloudinary.config(
|
|
19 |
|
20 |
API_URL = "https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-xl-base-1.0"
|
21 |
HEADERS = {"Authorization": f"Bearer {os.getenv('HUGGING_FACE_API_KEY')}"}
|
22 |
-
|
23 |
|
24 |
async def query(session, payload):
|
25 |
try:
|
@@ -44,6 +44,9 @@ async def retry_query(payload, retries=5, delay=30):
|
|
44 |
async def generate_image():
|
45 |
try:
|
46 |
data = request.json # This is synchronous
|
|
|
|
|
|
|
47 |
positive_prompt = data.get('positive_prompt', 'emma stone')
|
48 |
negative_prompt = data.get('negative_prompt', '[deformed | disfigured] , poorly drawn, [bad : wrong] anatomy, [extra | missing | floating | disconnected] limb, (mutated hands and fingers) , blurry,clothes, bad lighting, low-quality, deformed, text, poorly drawn, holding camera, bad art, bad angle, boring, low-resolution, worst quality, bad composition, disfigured')
|
49 |
style = data.get('style','');
|
|
|
19 |
|
20 |
API_URL = "https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-xl-base-1.0"
|
21 |
HEADERS = {"Authorization": f"Bearer {os.getenv('HUGGING_FACE_API_KEY')}"}
|
22 |
+
|
23 |
|
24 |
async def query(session, payload):
|
25 |
try:
|
|
|
44 |
async def generate_image():
|
45 |
try:
|
46 |
data = request.json # This is synchronous
|
47 |
+
logging.info(f"Received data: {data}")
|
48 |
+
logging.info(f"Received data: {os.getenv('HUGGING_FACE_API_KEY')}")
|
49 |
+
|
50 |
positive_prompt = data.get('positive_prompt', 'emma stone')
|
51 |
negative_prompt = data.get('negative_prompt', '[deformed | disfigured] , poorly drawn, [bad : wrong] anatomy, [extra | missing | floating | disconnected] limb, (mutated hands and fingers) , blurry,clothes, bad lighting, low-quality, deformed, text, poorly drawn, holding camera, bad art, bad angle, boring, low-resolution, worst quality, bad composition, disfigured')
|
52 |
style = data.get('style','');
|