Skip to content

Commit b2f17dd

Browse files
committed
prevent include_init_images from being passed to StableDiffusionProcessingImg2Img in API #4989
1 parent ae81b37 commit b2f17dd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

modules/api/api.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,10 @@ def img2imgapi(self, img2imgreq: StableDiffusionImg2ImgProcessingAPI):
152152
)
153153
if populate.sampler_name:
154154
populate.sampler_index = None # prevent a warning later on
155-
p = StableDiffusionProcessingImg2Img(**vars(populate))
155+
156+
args = vars(populate)
157+
args.pop('include_init_images', None) # this is meant to be done by "exclude": True in model, but it's for a reason that I cannot determine.
158+
p = StableDiffusionProcessingImg2Img(**args)
156159

157160
imgs = []
158161
for img in init_images:
@@ -170,7 +173,7 @@ def img2imgapi(self, img2imgreq: StableDiffusionImg2ImgProcessingAPI):
170173

171174
b64images = list(map(encode_pil_to_base64, processed.images))
172175

173-
if (not img2imgreq.include_init_images):
176+
if not img2imgreq.include_init_images:
174177
img2imgreq.init_images = None
175178
img2imgreq.mask = None
176179

0 commit comments

Comments
 (0)