Bug Fixes
This commit is contained in:
@@ -1086,6 +1086,7 @@ class SDTrainer(BaseSDTrainProcess):
|
|||||||
is_training=True,
|
is_training=True,
|
||||||
has_been_preprocessed=True,
|
has_been_preprocessed=True,
|
||||||
quad_count=quad_count,
|
quad_count=quad_count,
|
||||||
|
batch_size=noisy_latents.shape[0]
|
||||||
)
|
)
|
||||||
|
|
||||||
with self.timer('encode_prompt'):
|
with self.timer('encode_prompt'):
|
||||||
|
|||||||
@@ -705,10 +705,11 @@ class CustomAdapter(torch.nn.Module):
|
|||||||
is_training=False,
|
is_training=False,
|
||||||
has_been_preprocessed=False,
|
has_been_preprocessed=False,
|
||||||
quad_count=4,
|
quad_count=4,
|
||||||
|
batch_size=1,
|
||||||
) -> PromptEmbeds:
|
) -> PromptEmbeds:
|
||||||
if self.adapter_type == 'ilora' or self.adapter_type == 'vision_direct' or self.adapter_type == 'te_augmenter':
|
if self.adapter_type == 'ilora' or self.adapter_type == 'vision_direct' or self.adapter_type == 'te_augmenter':
|
||||||
if tensors_0_1 is None:
|
if tensors_0_1 is None:
|
||||||
tensors_0_1 = self.get_empty_clip_image(1)
|
tensors_0_1 = self.get_empty_clip_image(batch_size)
|
||||||
has_been_preprocessed = True
|
has_been_preprocessed = True
|
||||||
|
|
||||||
with torch.no_grad():
|
with torch.no_grad():
|
||||||
|
|||||||
@@ -78,7 +78,13 @@ class InstantLoRAMidModule(torch.nn.Module):
|
|||||||
raise e
|
raise e
|
||||||
# apply tanh to limit values to -1 to 1
|
# apply tanh to limit values to -1 to 1
|
||||||
# scaler = torch.tanh(scaler)
|
# scaler = torch.tanh(scaler)
|
||||||
return x * scaler
|
try:
|
||||||
|
return x * scaler
|
||||||
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
|
print(x.shape)
|
||||||
|
print(scaler.shape)
|
||||||
|
raise e
|
||||||
|
|
||||||
|
|
||||||
class InstantLoRAModule(torch.nn.Module):
|
class InstantLoRAModule(torch.nn.Module):
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ from toolkit.pipelines import CustomStableDiffusionXLPipeline, CustomStableDiffu
|
|||||||
StableDiffusionKDiffusionXLPipeline, StableDiffusionXLRefinerPipeline
|
StableDiffusionKDiffusionXLPipeline, StableDiffusionXLRefinerPipeline
|
||||||
from diffusers import StableDiffusionPipeline, StableDiffusionXLPipeline, T2IAdapter, DDPMScheduler, \
|
from diffusers import StableDiffusionPipeline, StableDiffusionXLPipeline, T2IAdapter, DDPMScheduler, \
|
||||||
StableDiffusionXLAdapterPipeline, StableDiffusionAdapterPipeline, DiffusionPipeline, \
|
StableDiffusionXLAdapterPipeline, StableDiffusionAdapterPipeline, DiffusionPipeline, \
|
||||||
StableDiffusionXLImg2ImgPipeline, LCMScheduler, Transformer2DModel, AutoencoderTiny
|
StableDiffusionXLImg2ImgPipeline, LCMScheduler, Transformer2DModel, AutoencoderTiny, ControlNetModel
|
||||||
import diffusers
|
import diffusers
|
||||||
from diffusers import \
|
from diffusers import \
|
||||||
AutoencoderKL, \
|
AutoencoderKL, \
|
||||||
@@ -142,7 +142,7 @@ class StableDiffusion:
|
|||||||
|
|
||||||
# to hold network if there is one
|
# to hold network if there is one
|
||||||
self.network = None
|
self.network = None
|
||||||
self.adapter: Union['T2IAdapter', 'IPAdapter', 'ReferenceAdapter', None] = None
|
self.adapter: Union['ControlNetModel', 'T2IAdapter', 'IPAdapter', 'ReferenceAdapter', None] = None
|
||||||
self.is_xl = model_config.is_xl
|
self.is_xl = model_config.is_xl
|
||||||
self.is_v2 = model_config.is_v2
|
self.is_v2 = model_config.is_v2
|
||||||
self.is_ssd = model_config.is_ssd
|
self.is_ssd = model_config.is_ssd
|
||||||
|
|||||||
Reference in New Issue
Block a user