multimodalart HF Staff commited on
Commit
09e9314
·
verified ·
1 Parent(s): 8db5bb1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -13
app.py CHANGED
@@ -11,16 +11,16 @@ pipe_14b = Cosmos2TextToImagePipeline.from_pretrained(model_14b_id,
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,
17
- safety_checker=pipe_14b.safety_checker,
18
- vae=pipe_14b.vae,
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,16 +35,15 @@ scheduler = EDMEulerScheduler(
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)):
42
 
43
  if model_choice == "14B":
44
  pipe = pipe_14b
45
- else:
46
- pipe = pipe_2b
47
- pipe.to("cuda")
48
 
49
  if randomize_seed:
50
  actual_seed = random.randint(0, 1000000)
 
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,
17
+ # safety_checker=pipe_14b.safety_checker,
18
+ # vae=pipe_14b.vae,
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)):
42
 
43
  if model_choice == "14B":
44
  pipe = pipe_14b
45
+ #else:
46
+ # pipe = pipe_2b
 
47
 
48
  if randomize_seed:
49
  actual_seed = random.randint(0, 1000000)