Update app.py
Browse files
app.py
CHANGED
@@ -31,6 +31,7 @@ def generate_image(prompt, negative_prompt=None, height=512, width=512, model="s
|
|
31 |
# Generate the image using Hugging Face's inference API with additional parameters
|
32 |
image = client.text_to_image(
|
33 |
prompt=prompt,
|
|
|
34 |
height=height,
|
35 |
width=width,
|
36 |
model=model,
|
@@ -50,6 +51,7 @@ def generate_api():
|
|
50 |
|
51 |
# Extract required fields from the request
|
52 |
prompt = data.get('prompt', '')
|
|
|
53 |
height = data.get('height', 1024) # Default height
|
54 |
width = data.get('width', 720) # Default width
|
55 |
num_inference_steps = data.get('num_inference_steps', 50) # Default number of inference steps
|
|
|
31 |
# Generate the image using Hugging Face's inference API with additional parameters
|
32 |
image = client.text_to_image(
|
33 |
prompt=prompt,
|
34 |
+
negative_prompt=negative_prompt,
|
35 |
height=height,
|
36 |
width=width,
|
37 |
model=model,
|
|
|
51 |
|
52 |
# Extract required fields from the request
|
53 |
prompt = data.get('prompt', '')
|
54 |
+
negative_prompt = data.get('negative_prompt', None)
|
55 |
height = data.get('height', 1024) # Default height
|
56 |
width = data.get('width', 720) # Default width
|
57 |
num_inference_steps = data.get('num_inference_steps', 50) # Default number of inference steps
|