multimodalart HF Staff commited on
Commit
6cee86a
·
verified ·
1 Parent(s): 650fb2e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -11,7 +11,6 @@ pipe_14b = Cosmos2TextToImagePipeline.from_pretrained(model_14b_id,
11
  revision="refs/pr/1",
12
  torch_dtype=torch.bfloat16
13
  )
14
- pipe_14b.to("cuda")
15
  pipe_2b = Cosmos2TextToImagePipeline.from_pretrained(model_2b_id,
16
  revision="refs/pr/2",
17
  text_encoder=pipe_14b.text_encoder,
@@ -20,6 +19,8 @@ pipe_2b = Cosmos2TextToImagePipeline.from_pretrained(model_2b_id,
20
  tokenizer=pipe_14b.tokenizer,
21
  torch_dtype=torch.bfloat16
22
  )
 
 
23
 
24
  scheduler = EDMEulerScheduler(
25
  sigma_min=0.002,
@@ -34,7 +35,7 @@ scheduler = EDMEulerScheduler(
34
  )
35
 
36
  pipe_14b.scheduler = scheduler
37
- # pipe_2b.scheduler = scheduler
38
 
39
  @spaces.GPU
40
  def generate_image(prompt, 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.", seed=42, randomize_seed=False, model_choice="14B", progress=gr.Progress(track_tqdm=True)):
 
11
  revision="refs/pr/1",
12
  torch_dtype=torch.bfloat16
13
  )
 
14
  pipe_2b = Cosmos2TextToImagePipeline.from_pretrained(model_2b_id,
15
  revision="refs/pr/2",
16
  text_encoder=pipe_14b.text_encoder,
 
19
  tokenizer=pipe_14b.tokenizer,
20
  torch_dtype=torch.bfloat16
21
  )
22
+ pipe_14b.to("cuda")
23
+ pipe_2b.to("cuda")
24
 
25
  scheduler = EDMEulerScheduler(
26
  sigma_min=0.002,
 
35
  )
36
 
37
  pipe_14b.scheduler = scheduler
38
+ pipe_2b.scheduler = scheduler
39
 
40
  @spaces.GPU
41
  def generate_image(prompt, 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.", seed=42, randomize_seed=False, model_choice="14B", progress=gr.Progress(track_tqdm=True)):