mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2025-12-09 21:04:41 +08:00
matplotlib optional as well
This commit is contained in:
parent
1afb92dee2
commit
2e7129fdb9
@ -4,11 +4,6 @@ from torchvision.transforms import functional as TF
|
||||
from PIL import Image, ImageDraw, ImageFilter, ImageFont
|
||||
import scipy.ndimage
|
||||
import numpy as np
|
||||
|
||||
try:
|
||||
import matplotlib.pyplot as plt
|
||||
except:
|
||||
print("Matplotlib not installed")
|
||||
from contextlib import nullcontext
|
||||
import os
|
||||
|
||||
@ -712,6 +707,7 @@ class CreateMagicMask:
|
||||
|
||||
def createmagicmask(self, frames, transitions, depth, distortion, seed, frame_width, frame_height):
|
||||
from ..utility.magictex import coordinate_grid, random_transform, magic
|
||||
import matplotlib.pyplot as plt
|
||||
rng = np.random.default_rng(seed)
|
||||
out = []
|
||||
coords = coordinate_grid((frame_width, frame_height))
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
import torch
|
||||
import torch.nn.functional as F
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
from PIL import Image
|
||||
|
||||
@ -1510,6 +1508,7 @@ or a .txt file with RealEstate camera intrinsics and coordinates, in a 3D plot.
|
||||
|
||||
def customize_legend(self, list_label):
|
||||
from matplotlib.patches import Patch
|
||||
import matplotlib.pyplot as plt
|
||||
list_handle = []
|
||||
for idx, label in enumerate(list_label):
|
||||
color = plt.cm.rainbow(idx / len(list_label))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user