Skip to content

Commit 51189f7

Browse files
committed
updated code for diffusers fix charactergen
1 parent ca83e19 commit 51189f7

File tree

4 files changed

+23
-18
lines changed

4 files changed

+23
-18
lines changed

Gen_3D_Modules/CharacterGen/Stage_2D/tuneavideo/models/unet_mv2d_condition.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,7 +1249,7 @@ def from_pretrained_2d(
12491249
return_unused_kwargs=True,
12501250
return_commit_hash=True,
12511251
force_download=force_download,
1252-
resume_download=resume_download,
1252+
# resume_download=resume_download,
12531253
proxies=proxies,
12541254
local_files_only=local_files_only,
12551255
use_auth_token=use_auth_token,
@@ -1304,7 +1304,7 @@ def from_pretrained_2d(
13041304
weights_name=_add_variant(SAFETENSORS_WEIGHTS_NAME, variant),
13051305
cache_dir=cache_dir,
13061306
force_download=force_download,
1307-
resume_download=resume_download,
1307+
# resume_download=resume_download,
13081308
proxies=proxies,
13091309
local_files_only=local_files_only,
13101310
use_auth_token=use_auth_token,
@@ -1323,7 +1323,7 @@ def from_pretrained_2d(
13231323
weights_name=_add_variant(WEIGHTS_NAME, variant),
13241324
cache_dir=cache_dir,
13251325
force_download=force_download,
1326-
resume_download=resume_download,
1326+
# resume_download=resume_download,
13271327
proxies=proxies,
13281328
local_files_only=local_files_only,
13291329
use_auth_token=use_auth_token,
@@ -1347,8 +1347,10 @@ def from_pretrained_2d(
13471347
default_attn_proc, enabled=name.endswith("attn1.processor"), name=name
13481348
)
13491349
model.set_attn_processor(unet_lora_attn_procs)
1350-
state_dict = load_state_dict(model_file, variant=variant)
1351-
model._convert_deprecated_attention_blocks(state_dict)
1350+
# state_dict = load_state_dict(model_file, variant=variant)
1351+
state_dict = load_state_dict(model_file)
1352+
1353+
# model._convert_deprecated_attention_blocks(state_dict)
13521354

13531355
conv_in_weight = state_dict['conv_in.weight']
13541356
conv_out_weight = state_dict['conv_out.weight']

Gen_3D_Modules/CharacterGen/Stage_2D/tuneavideo/models/unet_mv2d_ref.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,7 +1310,7 @@ def from_pretrained_2d(
13101310
return_unused_kwargs=True,
13111311
return_commit_hash=True,
13121312
force_download=force_download,
1313-
resume_download=resume_download,
1313+
# resume_download=resume_download,
13141314
proxies=proxies,
13151315
local_files_only=local_files_only,
13161316
use_auth_token=use_auth_token,
@@ -1365,7 +1365,7 @@ def from_pretrained_2d(
13651365
weights_name=_add_variant(SAFETENSORS_WEIGHTS_NAME, variant),
13661366
cache_dir=cache_dir,
13671367
force_download=force_download,
1368-
resume_download=resume_download,
1368+
# resume_download=resume_download,
13691369
proxies=proxies,
13701370
local_files_only=local_files_only,
13711371
use_auth_token=use_auth_token,
@@ -1384,7 +1384,7 @@ def from_pretrained_2d(
13841384
weights_name=_add_variant(WEIGHTS_NAME, variant),
13851385
cache_dir=cache_dir,
13861386
force_download=force_download,
1387-
resume_download=resume_download,
1387+
# resume_download=resume_download,
13881388
proxies=proxies,
13891389
local_files_only=local_files_only,
13901390
use_auth_token=use_auth_token,
@@ -1408,8 +1408,9 @@ def from_pretrained_2d(
14081408
default_attn_proc, enabled=name.endswith("attn1.processor"), name=name
14091409
)
14101410
model.set_attn_processor(unet_lora_attn_procs)
1411-
state_dict = load_state_dict(model_file, variant=variant)
1412-
model._convert_deprecated_attention_blocks(state_dict)
1411+
# state_dict = load_state_dict(model_file, variant=variant)
1412+
state_dict = load_state_dict(model_file)
1413+
# model._convert_deprecated_attention_blocks(state_dict)
14131414

14141415
conv_in_weight = state_dict['conv_in.weight']
14151416
conv_out_weight = state_dict['conv_out.weight']

Gen_3D_Modules/Era3D/mvdiffusion/models/unet_mv2d_condition.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,7 +1417,7 @@ def from_pretrained_2d(
14171417
return_unused_kwargs=True,
14181418
return_commit_hash=True,
14191419
force_download=force_download,
1420-
resume_download=resume_download,
1420+
# resume_download=resume_download,
14211421
proxies=proxies,
14221422
local_files_only=local_files_only,
14231423
use_auth_token=use_auth_token,
@@ -1476,7 +1476,7 @@ def from_pretrained_2d(
14761476
weights_name=_add_variant(SAFETENSORS_WEIGHTS_NAME, variant),
14771477
cache_dir=cache_dir,
14781478
force_download=force_download,
1479-
resume_download=resume_download,
1479+
# resume_download=resume_download,
14801480
proxies=proxies,
14811481
local_files_only=local_files_only,
14821482
use_auth_token=use_auth_token,
@@ -1495,7 +1495,7 @@ def from_pretrained_2d(
14951495
weights_name=_add_variant(WEIGHTS_NAME, variant),
14961496
cache_dir=cache_dir,
14971497
force_download=force_download,
1498-
resume_download=resume_download,
1498+
# resume_download=resume_download,
14991499
proxies=proxies,
15001500
local_files_only=local_files_only,
15011501
use_auth_token=use_auth_token,
@@ -1507,7 +1507,8 @@ def from_pretrained_2d(
15071507

15081508
model = cls.from_config(config, **unused_kwargs)
15091509
import copy
1510-
state_dict_pretrain = load_state_dict(model_file, variant=variant)
1510+
# state_dict_pretrain = load_state_dict(model_file, variant=variant)
1511+
state_dict = load_state_dict(model_file)
15111512
state_dict = copy.deepcopy(state_dict_pretrain)
15121513

15131514
if init_mvattn_with_selfattn:

Gen_3D_Modules/Wonder3D/models/unet_mv2d_condition.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,7 +1222,7 @@ def from_pretrained_2d(
12221222
return_unused_kwargs=True,
12231223
return_commit_hash=True,
12241224
force_download=force_download,
1225-
resume_download=resume_download,
1225+
# resume_download=resume_download,
12261226
proxies=proxies,
12271227
local_files_only=local_files_only,
12281228
use_auth_token=use_auth_token,
@@ -1278,7 +1278,7 @@ def from_pretrained_2d(
12781278
weights_name=_add_variant(SAFETENSORS_WEIGHTS_NAME, variant),
12791279
cache_dir=cache_dir,
12801280
force_download=force_download,
1281-
resume_download=resume_download,
1281+
# resume_download=resume_download,
12821282
proxies=proxies,
12831283
local_files_only=local_files_only,
12841284
use_auth_token=use_auth_token,
@@ -1297,7 +1297,7 @@ def from_pretrained_2d(
12971297
weights_name=_add_variant(WEIGHTS_NAME, variant),
12981298
cache_dir=cache_dir,
12991299
force_download=force_download,
1300-
resume_download=resume_download,
1300+
# resume_download=resume_download,
13011301
proxies=proxies,
13021302
local_files_only=local_files_only,
13031303
use_auth_token=use_auth_token,
@@ -1309,7 +1309,8 @@ def from_pretrained_2d(
13091309

13101310
model = cls.from_config(config, **unused_kwargs)
13111311
import copy
1312-
state_dict_v0 = load_state_dict(model_file, variant=variant)
1312+
# state_dict_v0 = load_state_dict(model_file, variant=variant)
1313+
state_dict_v0 = load_state_dict(model_file)
13131314
state_dict = copy.deepcopy(state_dict_v0)
13141315
# attn_joint -> attn_joint_last; norm_joint -> norm_joint_last
13151316
# attn_joint_twice -> attn_joint_mid; norm_joint_twice -> norm_joint_mid

0 commit comments

Comments
 (0)