Update app.py
Browse files
app.py
CHANGED
@@ -26,12 +26,12 @@ def is_prompt_explicit(prompt):
|
|
26 |
return False
|
27 |
|
28 |
# Function to generate an image from a text prompt
|
29 |
-
def generate_image(prompt, negative_prompt, height=512, width=512, model="stabilityai/stable-diffusion-2-1", num_inference_steps=50, guidance_scale=7.5, seed=None):
|
30 |
try:
|
31 |
# Generate the image using Hugging Face's inference API with additional parameters
|
32 |
image = client.text_to_image(
|
33 |
prompt=prompt,
|
34 |
-
|
35 |
height=height,
|
36 |
width=width,
|
37 |
model=model,
|
|
|
26 |
return False
|
27 |
|
28 |
# Function to generate an image from a text prompt
|
29 |
+
def generate_image(prompt, negative_prompt=None, height=512, width=512, model="stabilityai/stable-diffusion-2-1", num_inference_steps=50, guidance_scale=7.5, seed=None):
|
30 |
try:
|
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,
|