mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
i
This commit is contained in:
@@ -98,6 +98,8 @@ model.load_state_dict(safetensors.torch.load_file('./sd_xl_base_1.0.safetensors'
|
||||
|
||||
# model.conditioner.cuda()
|
||||
|
||||
with torch.no_grad():
|
||||
|
||||
model.conditioner.embedders[0].device = 'cpu'
|
||||
model.conditioner.embedders[1].device = 'cpu'
|
||||
|
||||
@@ -142,11 +144,8 @@ with torch.no_grad():
|
||||
torch.cuda.empty_cache()
|
||||
torch.cuda.ipc_collect()
|
||||
|
||||
a = 0
|
||||
|
||||
|
||||
with torch.no_grad():
|
||||
model.first_stage_model.cuda()
|
||||
model.first_stage_model.to(torch.float16).cuda()
|
||||
samples_x = model.decode_first_stage(samples_z)
|
||||
samples = torch.clamp((samples_x + 1.0) / 2.0, min=0.0, max=1.0)
|
||||
model.first_stage_model.cpu()
|
||||
|
||||
Reference in New Issue
Block a user