Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -5,23 +5,13 @@ from diffusers import Cosmos2TextToImagePipeline, EDMEulerScheduler
|
|
5 |
import random
|
6 |
|
7 |
model_14b_id = "nvidia/Cosmos-Predict2-14B-Text2Image"
|
8 |
-
model_2b_id = "nvidia/Cosmos-Predict2-2B-Text2Image"
|
9 |
|
10 |
pipe_14b = Cosmos2TextToImagePipeline.from_pretrained(model_14b_id,
|
11 |
revision="refs/pr/1",
|
12 |
torch_dtype=torch.bfloat16
|
13 |
)
|
14 |
|
15 |
-
#pipe_2b = Cosmos2TextToImagePipeline.from_pretrained(model_2b_id,
|
16 |
-
# revision="refs/pr/2",
|
17 |
-
# text_encoder=pipe_14b.text_encoder,
|
18 |
-
# safety_checker=pipe_14b.safety_checker,
|
19 |
-
# vae=pipe_14b.vae,
|
20 |
-
# tokenizer=pipe_14b.tokenizer,
|
21 |
-
# torch_dtype=torch.bfloat16
|
22 |
-
# )
|
23 |
pipe_14b.to("cuda")
|
24 |
-
#pipe_2b.to("cuda")
|
25 |
|
26 |
scheduler = EDMEulerScheduler(
|
27 |
sigma_min=0.002,
|
@@ -38,7 +28,7 @@ scheduler = EDMEulerScheduler(
|
|
38 |
pipe_14b.scheduler = scheduler
|
39 |
# pipe_2b.scheduler = scheduler
|
40 |
|
41 |
-
@spaces.GPU(duration=
|
42 |
def generate_image(prompt,
|
43 |
negative_prompt="The video captures a series of frames showing ugly scenes, static with no motion, motion blur, over-saturation, shaky footage, low resolution, grainy texture, pixelated images, poorly lit areas, underexposed and overexposed scenes, poor color balance, washed out colors, choppy sequences, jerky movements, low frame rate, artifacting, color banding, unnatural transitions, outdated special effects, fake elements, unconvincing visuals, poorly edited content, jump cuts, visual noise, and flickering. Overall, the video is of poor quality.",
|
44 |
seed=42,
|
|
|
5 |
import random
|
6 |
|
7 |
model_14b_id = "nvidia/Cosmos-Predict2-14B-Text2Image"
|
|
|
8 |
|
9 |
pipe_14b = Cosmos2TextToImagePipeline.from_pretrained(model_14b_id,
|
10 |
revision="refs/pr/1",
|
11 |
torch_dtype=torch.bfloat16
|
12 |
)
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
pipe_14b.to("cuda")
|
|
|
15 |
|
16 |
scheduler = EDMEulerScheduler(
|
17 |
sigma_min=0.002,
|
|
|
28 |
pipe_14b.scheduler = scheduler
|
29 |
# pipe_2b.scheduler = scheduler
|
30 |
|
31 |
+
@spaces.GPU(duration=120)
|
32 |
def generate_image(prompt,
|
33 |
negative_prompt="The video captures a series of frames showing ugly scenes, static with no motion, motion blur, over-saturation, shaky footage, low resolution, grainy texture, pixelated images, poorly lit areas, underexposed and overexposed scenes, poor color balance, washed out colors, choppy sequences, jerky movements, low frame rate, artifacting, color banding, unnatural transitions, outdated special effects, fake elements, unconvincing visuals, poorly edited content, jump cuts, visual noise, and flickering. Overall, the video is of poor quality.",
|
34 |
seed=42,
|