sd3 only
Browse files- App/Generate/database/Vercel.py +28 -15
App/Generate/database/Vercel.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import aiohttp, asyncio, pprint
|
2 |
from collections import deque
|
|
|
3 |
|
4 |
|
5 |
class AsyncImageGenerator:
|
@@ -13,6 +14,14 @@ class AsyncImageGenerator:
|
|
13 |
try:
|
14 |
url = f"{self.base}/predictions"
|
15 |
data = {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
# "input": {
|
17 |
# "prompt": payload,
|
18 |
# "negative_prompt": "CGI, Unreal, Airbrushed, Digital",
|
@@ -23,24 +32,27 @@ class AsyncImageGenerator:
|
|
23 |
# "num_inference_steps": 30,
|
24 |
# "guidance_scale": 2,
|
25 |
# },
|
26 |
-
"input": {
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
},
|
|
|
37 |
# "input": {
|
38 |
# "prompt": payload,
|
39 |
# "aspect_ratio": "9:16",
|
40 |
# "output_quality": 79,
|
41 |
# "negative_prompt": "doll opened mouth toy, text, sculpture pixar, cartoon, anime, low quality, plastic, 2 heads, 2 faces, poorly drawn, ugly, poorly drawn face, extra arms, extra legs, ugly, bad anatomy, bad fingers, ugly, deformed, noisy, blurry, distorted, grainy, nudity, nude",
|
42 |
# },
|
43 |
-
"path": "models/playgroundai/playground-v2.5-1024px-aesthetic/versions/a45f82a1382bed5c7aeb861dac7c7d191b0fdf74d8d57c4a0e6ed7d4d0bf7d24",
|
|
|
|
|
44 |
# "path": "models/stability-ai/stable-diffusion-3",
|
45 |
# "path": "models/lucataco/proteus-v0.4/versions/34a427535a3c45552b94369280b823fcd0e5c9710e97af020bf445c033d4569e",
|
46 |
# "path": "models/lucataco/juggernaut-xl-v9/versions/bea09cf018e513cef0841719559ea86d2299e05448633ac8fe270b5d5cd6777e",
|
@@ -73,6 +85,7 @@ class AsyncImageGenerator:
|
|
73 |
status["status"] = "404"
|
74 |
|
75 |
while status["status"] != "succeeded":
|
|
|
76 |
try:
|
77 |
status = await self._fetch_image_status(image_id)
|
78 |
except Exception as e:
|
@@ -118,11 +131,11 @@ async def process_images(payloads):
|
|
118 |
# # # Example payloads
|
119 |
# payloads = [
|
120 |
# """
|
|
|
121 |
|
122 |
-
#
|
123 |
-
|
124 |
|
125 |
-
#
|
126 |
# ]
|
127 |
|
128 |
|
|
|
1 |
import aiohttp, asyncio, pprint
|
2 |
from collections import deque
|
3 |
+
import json
|
4 |
|
5 |
|
6 |
class AsyncImageGenerator:
|
|
|
14 |
try:
|
15 |
url = f"{self.base}/predictions"
|
16 |
data = {
|
17 |
+
"input": {
|
18 |
+
"prompt": payload
|
19 |
+
+ """
|
20 |
+
""",
|
21 |
+
# "aspect_ratio": "2:3",
|
22 |
+
"negative_prompt": "text, watermark, blurry, haze, low contrast, low quality, underexposed, ugly, deformed, boring, bad quality, cartoon, ((disfigured)), ((bad art)), ((deformed)), ((poorly drawn)), ((extra limbs)), ((close up)), ((b&w)), weird colors, blurry, ugly, tiling, poorly drawn hands, poorly drawn feet, poorly drawn face, out of frame, extra limbs, disfigured, body out of frame, blurry, bad anatomy, blurred, watermark, grainy, signature, cut off, draft, low detail, low quality, double face, 2 faces, cropped, ugly, low-res, tiling, grainy, cropped, ostentatious, ugly, oversaturated, grain, low resolution, disfigured, blurry, bad anatomy, disfigured, poorly drawn face, mutant, mutated, extra limb, ugly, poorly drawn hands, missing limbs, blurred, floating limbs, disjointed limbs, deformed hands, blurred, out of focus, long neck, long body, ugly, disgusting, childish, cut off cropped, distorted, imperfect, surreal, bad hands, text, error, extra digit, fewer digits, cropped , worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, artist name, Lots of hands, extra limbs, extra fingers, conjoined fingers, deformed fingers, old, ugly eyes, imperfect eyes, skewed eyes , unnatural face, stiff face, stiff body, unbalanced body, unnatural body, lacking body, details are not clear, cluttered, details are sticky, details are low, distorted details, ugly hands, imperfect hands, (mutated hands and fingers:1.5), (long body :1.3), (mutation, poorly drawn :1.2) bad hands, fused ha nd, missing hand, disappearing arms, hands, disappearing thigh, disappearing calf, disappearing legs, ui, missing fingers",
|
23 |
+
"steps": 28,
|
24 |
+
},
|
25 |
# "input": {
|
26 |
# "prompt": payload,
|
27 |
# "negative_prompt": "CGI, Unreal, Airbrushed, Digital",
|
|
|
32 |
# "num_inference_steps": 30,
|
33 |
# "guidance_scale": 2,
|
34 |
# },
|
35 |
+
# "input": {
|
36 |
+
# "width": 1024,
|
37 |
+
# "height": 1536,
|
38 |
+
# "prompt": payload,
|
39 |
+
# "scheduler": "DPMSolver++",
|
40 |
+
# "num_outputs": 1,
|
41 |
+
# "guidance_scale": 3,
|
42 |
+
# "negative_prompt": "doll opened mouth toy, text, sculpture pixar, cartoon, anime, low quality, plastic, 2 heads, 2 faces, poorly drawn, ugly, poorly drawn face, extra arms, extra legs, ugly, bad anatomy, bad fingers, ugly, deformed, noisy, blurry, distorted, grainy, nudity, nude",
|
43 |
+
# # "negative_prompt": "text, watermark, blurry, haze, low contrast, low quality, underexposed, ugly, deformed, boring, bad quality, cartoon, ((disfigured)), ((bad art)), ((deformed)), ((poorly drawn)), ((extra limbs)), ((close up)), ((b&w)), weird colors, blurry, ugly, tiling, poorly drawn hands, poorly drawn feet, poorly drawn face, out of frame, extra limbs, disfigured, body out of frame, blurry, bad anatomy, blurred, watermark, grainy, signature, cut off, draft, low detail, low quality, double face, 2 faces, cropped, ugly, low-res, tiling, grainy, cropped, ostentatious, ugly, oversaturated, grain, low resolution, disfigured, blurry, bad anatomy, disfigured, poorly drawn face, mutant, mutated, extra limb, ugly, poorly drawn hands, missing limbs, blurred, floating limbs, disjointed limbs, deformed hands, blurred, out of focus, long neck, long body, ugly, disgusting, childish, cut off cropped, distorted, imperfect, surreal, bad hands, text, error, extra digit, fewer digits, cropped , worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, artist name, Lots of hands, extra limbs, extra fingers, conjoined fingers, deformed fingers, old, ugly eyes, imperfect eyes, skewed eyes , unnatural face, stiff face, stiff body, unbalanced body, unnatural body, lacking body, details are not clear, cluttered, details are sticky, details are low, distorted details, ugly hands, imperfect hands, (mutated hands and fingers:1.5), (long body :1.3), (mutation, poorly drawn :1.2) bad hands, fused ha nd, missing hand, disappearing arms, hands, disappearing thigh, disappearing calf, disappearing legs, ui, missing fingers",
|
44 |
+
# "num_inference_steps": 25,
|
45 |
+
# },
|
46 |
+
# "input": {"workflow_json": payload},
|
47 |
# "input": {
|
48 |
# "prompt": payload,
|
49 |
# "aspect_ratio": "9:16",
|
50 |
# "output_quality": 79,
|
51 |
# "negative_prompt": "doll opened mouth toy, text, sculpture pixar, cartoon, anime, low quality, plastic, 2 heads, 2 faces, poorly drawn, ugly, poorly drawn face, extra arms, extra legs, ugly, bad anatomy, bad fingers, ugly, deformed, noisy, blurry, distorted, grainy, nudity, nude",
|
52 |
# },
|
53 |
+
# "path": "models/playgroundai/playground-v2.5-1024px-aesthetic/versions/a45f82a1382bed5c7aeb861dac7c7d191b0fdf74d8d57c4a0e6ed7d4d0bf7d24",
|
54 |
+
# "path": "models/fofr/any-comfyui-workflow/versions/cd385285ba75685a040afbded7b79814a971f3febf46c5eab7c716e200c784e1",
|
55 |
+
"path": "models/fofr/sd3-explorer/versions/a9f4aebd943ad7db13de8e34debea359d5578d08f128e968f9a36c3e9b0148d4",
|
56 |
# "path": "models/stability-ai/stable-diffusion-3",
|
57 |
# "path": "models/lucataco/proteus-v0.4/versions/34a427535a3c45552b94369280b823fcd0e5c9710e97af020bf445c033d4569e",
|
58 |
# "path": "models/lucataco/juggernaut-xl-v9/versions/bea09cf018e513cef0841719559ea86d2299e05448633ac8fe270b5d5cd6777e",
|
|
|
85 |
status["status"] = "404"
|
86 |
|
87 |
while status["status"] != "succeeded":
|
88 |
+
print(status["status"])
|
89 |
try:
|
90 |
status = await self._fetch_image_status(image_id)
|
91 |
except Exception as e:
|
|
|
131 |
# # # Example payloads
|
132 |
# payloads = [
|
133 |
# """
|
134 |
+
# Sophie is a college student who is bright-eyed with curly hair and freckles and initially wears oversized sweater and ripped jeans. Max is a elderly neighbor who is kind-faced with silver hair and glasses wearing cardigan and slacks. Buddy is a golden retriever who is friendly and energetic wearing red collar. In this scene, Sophie is tossing her graduation cap, Sophie is wearing graduation gown and cap, Sophie is center of the frame, Max is applauding proudly, Max is to Sophie's right, Buddy is barking excitedly, Buddy is at Sophie's feet. The scene takes place in college campus with other graduates and families. Sophie's graduation celebration. Lighting: Golden hour sunlight. Camera: Slow-motion shot focusing on Sophie's joyful face.
|
135 |
|
136 |
+
# The artwork pays homage to the legendary Frank Frazetta, showcasing the distinctive styles of Loish van Baarle and the dynamic brushwork of Boris Vallejo. This masterpiece, a tribute to the talents of renowned artists Ross Tran, Greg Tocchini, Tom Bagshaw, and Steve Henderson, creates a captivating and enchanting scene.
|
|
|
137 |
|
138 |
+
# """
|
139 |
# ]
|
140 |
|
141 |
|