Skip to content

Commit

Permalink
🐛 Backward compatible with A1111 1< 1.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei committed Jan 4, 2024
1 parent c714019 commit 792737a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions javascript/active_units.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,16 +284,18 @@

attachA1111HrObserver() {
if (this.isImg2Img) return;

const hr_checkbox = gradioApp().querySelector('#txt2img_hr-visible-checkbox');
if (!hr_checkbox) return; // For backward compatibility for A1111 < 1.7.0

hr_checkbox.addEventListener('change', () => {
if (hr_checkbox.checked) {
this.hrOptionRadioGroup.removeAttribute('hidden');
} else {
this.hrOptionRadioGroup.setAttribute('hidden', '');
}
});

// Hide initially as hr is disabled by default.
this.hrOptionRadioGroup.setAttribute('hidden', '');
}
Expand Down

0 comments on commit 792737a

Please sign in to comment.