BladeSzaSza commited on
Commit
48235bb
·
1 Parent(s): cc6b5d3

enable foreign code

Browse files
models/image_generator.py CHANGED
@@ -36,7 +36,8 @@ class OmniGenImageGenerator:
36
  self.model_id,
37
  torch_dtype=torch_dtype,
38
  use_safetensors=True,
39
- variant="fp16" if self.device == "cuda" else None
 
40
  )
41
 
42
  # Apply optimizations
@@ -79,7 +80,8 @@ class OmniGenImageGenerator:
79
  self.pipeline = StableDiffusionPipeline.from_pretrained(
80
  self.model_id,
81
  torch_dtype=torch_dtype,
82
- use_safetensors=True
 
83
  )
84
 
85
  if self.device == "cuda" and self.enable_cpu_offload:
 
36
  self.model_id,
37
  torch_dtype=torch_dtype,
38
  use_safetensors=True,
39
+ variant="fp16" if self.device == "cuda" else None,
40
+ trust_remote_code=True
41
  )
42
 
43
  # Apply optimizations
 
80
  self.pipeline = StableDiffusionPipeline.from_pretrained(
81
  self.model_id,
82
  torch_dtype=torch_dtype,
83
+ use_safetensors=True,
84
+ trust_remote_code=True
85
  )
86
 
87
  if self.device == "cuda" and self.enable_cpu_offload:
models/model_3d_generator.py CHANGED
@@ -58,7 +58,8 @@ class Hunyuan3DGenerator:
58
  model_id,
59
  torch_dtype=torch_dtype,
60
  low_cpu_mem_usage=True,
61
- device_map="auto" if self.device == "cuda" else None
 
62
  )
63
 
64
  if self.device == "cpu":
 
58
  model_id,
59
  torch_dtype=torch_dtype,
60
  low_cpu_mem_usage=True,
61
+ device_map="auto" if self.device == "cuda" else None,
62
+ trust_remote_code=True
63
  )
64
 
65
  if self.device == "cpu":