mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
29 lines
730 B
Python
29 lines
730 B
Python
'''
|
|
Initialization file for invokeai.backend.image_util methods.
|
|
'''
|
|
from .patchmatch import PatchMatch
|
|
from .txt2mask import Txt2Mask
|
|
from .util import InitImageResizer, make_grid
|
|
from .pngwriter import (PngWriter,
|
|
PromptFormatter,
|
|
retrieve_metadata,
|
|
write_metadata,
|
|
)
|
|
|
|
def debug_image(
|
|
debug_image, debug_text, debug_show=True, debug_result=False, debug_status=False
|
|
):
|
|
if not debug_status:
|
|
return
|
|
|
|
image_copy = debug_image.copy().convert("RGBA")
|
|
ImageDraw.Draw(image_copy).text((5, 5), debug_text, (255, 0, 0))
|
|
|
|
if debug_show:
|
|
image_copy.show()
|
|
|
|
if debug_result:
|
|
return image_copy
|
|
|
|
|