mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-02-05 23:49:57 +00:00
preserve infotext with Extras > Single Image (#2006)
credit to @PumpkinHat https://github.com/lllyasviel/stable-diffusion-webui-forge/issues/1779#issuecomment-2364974588
This commit is contained in:
@@ -77,6 +77,7 @@ class LogicalImage(gr.Textbox):
|
||||
@wraps(gr.Textbox.__init__)
|
||||
def __init__(self, *args, numpy=True, **kwargs):
|
||||
self.numpy = numpy
|
||||
self.infotext = dict()
|
||||
|
||||
if 'value' in kwargs:
|
||||
initial_value = kwargs['value']
|
||||
@@ -94,11 +95,16 @@ class LogicalImage(gr.Textbox):
|
||||
if not payload.startswith("data:image/png;base64,"):
|
||||
return None
|
||||
|
||||
return base64_to_image(payload, numpy=self.numpy)
|
||||
image = base64_to_image(payload, numpy=self.numpy)
|
||||
image.info = self.infotext
|
||||
|
||||
return image
|
||||
|
||||
def postprocess(self, value):
|
||||
if value is None:
|
||||
return None
|
||||
|
||||
self.infotext = value.info
|
||||
|
||||
return image_to_base64(value, numpy=self.numpy)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user