Maximofn commited on
Commit
8db257f
·
1 Parent(s): 97ab6fc

fix(src): :rocket: Remove lines

Browse files
Files changed (1) hide show
  1. app.py +3 -9
app.py CHANGED
@@ -1,6 +1,5 @@
1
  import spaces
2
  import torch
3
- # from diffusers import BitsAndBytesConfig
4
  from diffusers import HunyuanVideoPipeline, HunyuanVideoTransformer3DModel
5
 
6
  import os
@@ -23,10 +22,10 @@ def generate_video(
23
  width, height = resolution.split("x")
24
  width, height = int(width), int(height)
25
 
 
26
  transformer_8bit = HunyuanVideoTransformer3DModel.from_pretrained(
27
  model,
28
  subfolder="transformer",
29
- # quantization_config=quant_config,
30
  torch_dtype=torch.bfloat16,
31
  device_map="balanced",
32
  )
@@ -62,7 +61,7 @@ def generate_video(
62
 
63
  return video_path
64
 
65
- def create_demo(model):
66
  with gr.Blocks() as demo:
67
  gr.Markdown("# Hunyuan Video Generation")
68
 
@@ -129,10 +128,5 @@ def create_demo(model):
129
 
130
  if __name__ == "__main__":
131
  print("Starting Gradio server...")
132
- # os.environ["GRADIO_ANALYTICS_ENABLED"] = "False"
133
- # server_name = os.getenv("SERVER_NAME", "0.0.0.0")
134
- # server_port = int(os.getenv("SERVER_PORT", "8081"))
135
- model = "hunyuanvideo-community/HunyuanVideo" # Actualizado el path del modelo
136
- demo = create_demo(model)
137
- # demo.launch(server_name=server_name, server_port=server_port)
138
  demo.launch()
 
1
  import spaces
2
  import torch
 
3
  from diffusers import HunyuanVideoPipeline, HunyuanVideoTransformer3DModel
4
 
5
  import os
 
22
  width, height = resolution.split("x")
23
  width, height = int(width), int(height)
24
 
25
+ model = "hunyuanvideo-community/HunyuanVideo"
26
  transformer_8bit = HunyuanVideoTransformer3DModel.from_pretrained(
27
  model,
28
  subfolder="transformer",
 
29
  torch_dtype=torch.bfloat16,
30
  device_map="balanced",
31
  )
 
61
 
62
  return video_path
63
 
64
+ def create_demo():
65
  with gr.Blocks() as demo:
66
  gr.Markdown("# Hunyuan Video Generation")
67
 
 
128
 
129
  if __name__ == "__main__":
130
  print("Starting Gradio server...")
131
+ demo = create_demo()
 
 
 
 
 
132
  demo.launch()