Kunpeng Song commited on
Commit
5b2734d
1 Parent(s): f8c6fde
Files changed (2) hide show
  1. .DS_Store +0 -0
  2. model_lib/moMA_generator.py +4 -5
.DS_Store CHANGED
Binary files a/.DS_Store and b/.DS_Store differ
 
model_lib/moMA_generator.py CHANGED
@@ -1,8 +1,7 @@
1
  import torch
2
  from model_lib.attention_processor import IPAttnProcessor, IPAttnProcessor_Self, get_mask_from_cross
3
- from diffusers import StableDiffusionPipeline, DDIMScheduler, AutoencoderKL
4
  import tqdm
5
-
6
 
7
  def get_subject_idx(model,prompt,src_subject,device):
8
  tokenized_prompt = model.tokenizer(prompt,padding="max_length",max_length=model.tokenizer.model_max_length,truncation=True,return_tensors="pt",).to(device)
@@ -82,13 +81,13 @@ class MoMA_generator:
82
  self.args = args
83
  self.device = device
84
 
85
- noise_scheduler = DDIMScheduler(num_train_timesteps=1000,beta_start=0.00085,beta_end=0.012,beta_schedule="scaled_linear",clip_sample=False,set_alpha_to_one=False,steps_offset=1,)
86
 
87
  print('Loading VAE: stabilityai--sd-vae-ft-mse...')
88
- vae = AutoencoderKL.from_pretrained("stabilityai/sd-vae-ft-mse")
89
 
90
  print('Loading StableDiffusion: Realistic_Vision...')
91
- self.pipe = StableDiffusionPipeline.from_pretrained(
92
  "SG161222/Realistic_Vision_V4.0_noVAE",
93
  torch_dtype=torch.float16,
94
  scheduler=noise_scheduler,
 
1
  import torch
2
  from model_lib.attention_processor import IPAttnProcessor, IPAttnProcessor_Self, get_mask_from_cross
 
3
  import tqdm
4
+ import diffusers
5
 
6
  def get_subject_idx(model,prompt,src_subject,device):
7
  tokenized_prompt = model.tokenizer(prompt,padding="max_length",max_length=model.tokenizer.model_max_length,truncation=True,return_tensors="pt",).to(device)
 
81
  self.args = args
82
  self.device = device
83
 
84
+ noise_scheduler = diffusers.DDIMScheduler(num_train_timesteps=1000,beta_start=0.00085,beta_end=0.012,beta_schedule="scaled_linear",clip_sample=False,set_alpha_to_one=False,steps_offset=1,)
85
 
86
  print('Loading VAE: stabilityai--sd-vae-ft-mse...')
87
+ vae = diffusers.AutoencoderKL.from_pretrained("stabilityai/sd-vae-ft-mse")
88
 
89
  print('Loading StableDiffusion: Realistic_Vision...')
90
+ self.pipe = diffusers.StableDiffusionPipeline.from_pretrained(
91
  "SG161222/Realistic_Vision_V4.0_noVAE",
92
  torch_dtype=torch.float16,
93
  scheduler=noise_scheduler,