Spaces:
Sleeping
Sleeping
commit
Browse files
app.py
CHANGED
@@ -57,12 +57,13 @@ additional_image = None
|
|
57 |
# precision data
|
58 |
|
59 |
seq=512
|
60 |
-
fps=
|
61 |
width=768
|
62 |
height=768
|
63 |
image_steps=8
|
64 |
-
video_steps=
|
65 |
-
|
|
|
66 |
|
67 |
# ui data
|
68 |
|
@@ -197,9 +198,10 @@ def pipe_generate(img,p1,p2,time,title):
|
|
197 |
negative_prompt=p2,
|
198 |
height=height,
|
199 |
width=width,
|
200 |
-
guidance_scale=
|
201 |
num_images_per_prompt=1,
|
202 |
num_inference_steps=image_steps,
|
|
|
203 |
max_sequence_length=seq,
|
204 |
generator=torch.Generator(device).manual_seed(int(str(random.random()).split(".")[1]))
|
205 |
).images[0]
|
@@ -207,7 +209,7 @@ def pipe_generate(img,p1,p2,time,title):
|
|
207 |
|
208 |
if title != "":
|
209 |
draw = ImageDraw.Draw(img)
|
210 |
-
textheight=
|
211 |
rows = 1
|
212 |
font = ImageFont.truetype(r"Alef-Bold.ttf", textheight)
|
213 |
textwidth = draw.textlength(title,font)
|
@@ -222,10 +224,11 @@ def pipe_generate(img,p1,p2,time,title):
|
|
222 |
|
223 |
return video_pipe(
|
224 |
prompt=p1,
|
|
|
225 |
negative_prompt=p2.replace("textual content, ",""),
|
226 |
image=img,
|
227 |
num_inference_steps=video_steps,
|
228 |
-
guidance_scale=
|
229 |
num_videos_per_prompt=1,
|
230 |
num_frames=(fps*time),
|
231 |
generator=torch.Generator(device).manual_seed(int(str(random.random()).split(".")[1]))
|
@@ -248,7 +251,7 @@ def handle_generate(*_inp):
|
|
248 |
if len(inp[1]) >= 2:
|
249 |
inp[1] = "," + inp[1].strip(",").strip(" ")
|
250 |
|
251 |
-
inp[1] = f'looks real,feels real,similar to real photographs,dark
|
252 |
|
253 |
print(f"""
|
254 |
|
|
|
57 |
# precision data
|
58 |
|
59 |
seq=512
|
60 |
+
fps=12
|
61 |
width=768
|
62 |
height=768
|
63 |
image_steps=8
|
64 |
+
video_steps=50
|
65 |
+
img_accu=9
|
66 |
+
vid_accu=6
|
67 |
|
68 |
# ui data
|
69 |
|
|
|
198 |
negative_prompt=p2,
|
199 |
height=height,
|
200 |
width=width,
|
201 |
+
guidance_scale=img_accu,
|
202 |
num_images_per_prompt=1,
|
203 |
num_inference_steps=image_steps,
|
204 |
+
safety_checker=None,
|
205 |
max_sequence_length=seq,
|
206 |
generator=torch.Generator(device).manual_seed(int(str(random.random()).split(".")[1]))
|
207 |
).images[0]
|
|
|
209 |
|
210 |
if title != "":
|
211 |
draw = ImageDraw.Draw(img)
|
212 |
+
textheight=min(( width // 10 ), ( height // 5 ))
|
213 |
rows = 1
|
214 |
font = ImageFont.truetype(r"Alef-Bold.ttf", textheight)
|
215 |
textwidth = draw.textlength(title,font)
|
|
|
224 |
|
225 |
return video_pipe(
|
226 |
prompt=p1,
|
227 |
+
safety_checker=None,
|
228 |
negative_prompt=p2.replace("textual content, ",""),
|
229 |
image=img,
|
230 |
num_inference_steps=video_steps,
|
231 |
+
guidance_scale=vid_accu,
|
232 |
num_videos_per_prompt=1,
|
233 |
num_frames=(fps*time),
|
234 |
generator=torch.Generator(device).manual_seed(int(str(random.random()).split(".")[1]))
|
|
|
251 |
if len(inp[1]) >= 2:
|
252 |
inp[1] = "," + inp[1].strip(",").strip(" ")
|
253 |
|
254 |
+
inp[1] = f'looks real,feels real,similar to real photographs,dark natural colors,looks beautiful and pretty,look genuine and authentic,reasonable logic,natural,masterpiece,highly detailed{inp[1]}'
|
255 |
|
256 |
print(f"""
|
257 |
|