Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -11,24 +11,25 @@ repo = "stabilityai/stable-diffusion-xl-base-1.0"
|
|
11 |
trigger_word = "T shirt design, TshirtDesignAF, "
|
12 |
|
13 |
def generate_images(prompt):
|
14 |
-
print("Generating images with prompt:", prompt)
|
15 |
api_url = f"https://api-inference.huggingface.co/models/{repo}"
|
16 |
#token = os.getenv("API_TOKEN") # Uncomment and use your Hugging Face API token
|
17 |
headers = {
|
18 |
#"Authorization": f"Bearer {token}"
|
19 |
}
|
20 |
-
|
21 |
-
payload = {
|
22 |
-
"inputs": full_prompt,
|
23 |
-
"parameters": {
|
24 |
-
"negative_prompt": "(worst quality, low quality, normal quality, lowres, low details, oversaturated, undersaturated, overexposed, underexposed, grayscale, bw, bad photo, bad photography, bad art:1.4), (watermark, signature, text font, username, error, logo, words, letters, digits, autograph, trademark, name:1.2), (blur, blurry, grainy), morbid, ugly, asymmetrical, mutated malformed, mutilated, poorly lit, bad shadow, draft, cropped, out of frame, cut off, censored, jpeg artifacts, out of focus, glitch, duplicate, (airbrushed, cartoon, anime, semi-realistic, cgi, render, blender, digital art, manga, amateur:1.3), (3D ,3D Game, 3D Game Scene, 3D Character:1.1), (bad hands, bad anatomy, bad body, bad face, bad teeth, bad arms, bad legs, deformities:1.3)",
|
25 |
-
"num_inference_steps": 30,
|
26 |
-
"scheduler": "DPMSolverMultistepScheduler"
|
27 |
-
},
|
28 |
-
}
|
29 |
-
|
30 |
images = []
|
31 |
for i in range(10):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
error_count = 0
|
33 |
pbar = tqdm(total=None, desc=f"Loading model {i+1}/10")
|
34 |
while True:
|
|
|
11 |
trigger_word = "T shirt design, TshirtDesignAF, "
|
12 |
|
13 |
def generate_images(prompt):
|
14 |
+
print("Generating 10 unique images with prompt:", prompt)
|
15 |
api_url = f"https://api-inference.huggingface.co/models/{repo}"
|
16 |
#token = os.getenv("API_TOKEN") # Uncomment and use your Hugging Face API token
|
17 |
headers = {
|
18 |
#"Authorization": f"Bearer {token}"
|
19 |
}
|
20 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
images = []
|
22 |
for i in range(10):
|
23 |
+
full_prompt = f"{prompt} {trigger_word} unique_design_{i}"
|
24 |
+
payload = {
|
25 |
+
"inputs": full_prompt,
|
26 |
+
"parameters": {
|
27 |
+
"negative_prompt": "(worst quality, low quality, normal quality, lowres, low details, oversaturated, undersaturated, overexposed, underexposed, grayscale, bw, bad photo, bad photography, bad art:1.4), (watermark, signature, text font, username, error, logo, words, letters, digits, autograph, trademark, name:1.2), (blur, blurry, grainy), morbid, ugly, asymmetrical, mutated malformed, mutilated, poorly lit, bad shadow, draft, cropped, out of frame, cut off, censored, jpeg artifacts, out of focus, glitch, duplicate, (airbrushed, cartoon, anime, semi-realistic, cgi, render, blender, digital art, manga, amateur:1.3), (3D ,3D Game, 3D Game Scene, 3D Character:1.1), (bad hands, bad anatomy, bad body, bad face, bad teeth, bad arms, bad legs, deformities:1.3)",
|
28 |
+
"num_inference_steps": 30,
|
29 |
+
"scheduler": "DPMSolverMultistepScheduler"
|
30 |
+
},
|
31 |
+
}
|
32 |
+
|
33 |
error_count = 0
|
34 |
pbar = tqdm(total=None, desc=f"Loading model {i+1}/10")
|
35 |
while True:
|