Skip to content

Commit fa2b401

Browse files
committed
Fixed problems with turning off FreeU in some scenarios
1 parent 6d47547 commit fa2b401

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

fooocus_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version = '2.0.78.3 MRE'
1+
version = '2.0.78.4 MRE'
22
full_version = 'Fooocus ' + version

modules/core.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,8 @@ def detect_edge(image, low_threshold, high_threshold):
187187
@torch.no_grad()
188188
@torch.inference_mode()
189189
def freeu(model, b1, b2, s1, s2):
190-
return opFreeU.patch(model=model, b1=b1, b2=b2, s1=s1, s2=s2)[0]
190+
unet = opFreeU.patch(model=model.unet, b1=b1, b2=b2, s1=s1, s2=s2)[0]
191+
return StableDiffusionModel(unet=unet, clip=model.clip, vae=model.vae, clip_vision=model.clip_vision)
191192

192193

193194
@torch.no_grad()

modules/default_pipeline.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,10 @@ def patch_base(loras, freeu, b1, b2, s1, s2):
130130
assert os.path.exists(filename), 'Lora file not found!'
131131

132132
model = core.load_sd_lora(model, filename, strength_model=weight, strength_clip=weight)
133-
xl_base_patched = model
134133
if freeu:
135-
xl_base_patched.unet = core.freeu(xl_base_patched.unet, b1, b2, s1, s2)
134+
xl_base_patched = core.freeu(model, b1, b2, s1, s2)
135+
else:
136+
xl_base_patched = model
136137
xl_base_patched_hash = str(loras + [freeu, b1, b2, s1, s2])
137138
print(f'LoRAs loaded: {loras}')
138139
if freeu:

update_log_mre.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
### 2.0.78.4 MRE
2+
3+
* Fixed problems with turning off FreeU in some scenarios.
4+
15
### 2.0.78.3 MRE
26

37
* Added limited support for non-SDXL models (no refiner, Control-LoRAs, Revision, inpainting, outpainting).

0 commit comments

Comments
 (0)