Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4861dccf7c | |||
| eed3b43252 | |||
| 48239090f1 | |||
| 82a973c043 | |||
| 1d7e9eca09 | |||
| 850e14923e | |||
| 8e0881d9ab | |||
| 834297b13d | |||
| c19d044364 |
@@ -1,3 +1,9 @@
|
|||||||
|
## 1.10.1
|
||||||
|
|
||||||
|
### Bug Fixes:
|
||||||
|
* fix image upscale on cpu ([#16275](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/16275))
|
||||||
|
|
||||||
|
|
||||||
## 1.10.0
|
## 1.10.0
|
||||||
|
|
||||||
### Features:
|
### Features:
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import gradio as gr
|
import gradio as gr
|
||||||
|
|
||||||
from modules import localization, shared, scripts, util
|
from modules import localization, shared, scripts, util
|
||||||
@@ -49,12 +50,21 @@ def css_html():
|
|||||||
return head
|
return head
|
||||||
|
|
||||||
|
|
||||||
|
re_preconnect = re.compile(rb'<link\s+rel="preconnect"\s+href="([^"]+)"(?:\s+[^>]*)?/?>')
|
||||||
|
|
||||||
|
|
||||||
def reload_javascript():
|
def reload_javascript():
|
||||||
js = javascript_html()
|
js = javascript_html()
|
||||||
css = css_html()
|
css = css_html()
|
||||||
|
|
||||||
def template_response(*args, **kwargs):
|
def template_response(*args, **kwargs):
|
||||||
res = shared.GradioTemplateResponseOriginal(*args, **kwargs)
|
res = shared.GradioTemplateResponseOriginal(*args, **kwargs)
|
||||||
|
|
||||||
|
# remove preconnects
|
||||||
|
res.body = re_preconnect.sub(b'', res.body)
|
||||||
|
# replace iframeResizer with local version
|
||||||
|
res.body = res.body.replace(b'src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.6/iframeResizer.contentWindow.min.js"', b'src="webui-assets/js/iframe-resizer/4.3.6/iframeResizer.contentWindow.min.js"')
|
||||||
|
|
||||||
res.body = res.body.replace(b'</head>', f'{js}<meta name="referrer" content="no-referrer"/></head>'.encode("utf8"))
|
res.body = res.body.replace(b'</head>', f'{js}<meta name="referrer" content="no-referrer"/></head>'.encode("utf8"))
|
||||||
res.body = res.body.replace(b'</body>', f'{css}</body>'.encode("utf8"))
|
res.body = res.body.replace(b'</body>', f'{css}</body>'.encode("utf8"))
|
||||||
res.init_headers()
|
res.init_headers()
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ def upscale_pil_patch(model, img: Image.Image) -> Image.Image:
|
|||||||
"""
|
"""
|
||||||
param = torch_utils.get_param(model)
|
param = torch_utils.get_param(model)
|
||||||
|
|
||||||
with torch.no_grad():
|
with torch.inference_mode():
|
||||||
tensor = pil_image_to_torch_bgr(img).unsqueeze(0) # add batch dimension
|
tensor = pil_image_to_torch_bgr(img).unsqueeze(0) # add batch dimension
|
||||||
tensor = tensor.to(device=param.device, dtype=param.dtype)
|
tensor = tensor.to(device=param.device, dtype=param.dtype)
|
||||||
with devices.without_autocast():
|
with devices.without_autocast():
|
||||||
|
|||||||
Reference in New Issue
Block a user