AlekseyCalvin commited on
Commit
2a30da1
·
verified ·
1 Parent(s): ad89ac3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -12
app.py CHANGED
@@ -47,18 +47,18 @@ pipe = FluxWithCFGPipeline.from_pretrained("ostris/OpenFLUX.1", torch_dtype=dtyp
47
  pipe.vae = AutoencoderTiny.from_pretrained("madebyollin/taef1", torch_dtype=dtype).to("cuda")
48
 
49
  pipe.to("cuda")
50
- clipmodel = 'norm'
51
- if clipmodel == "long":
52
- model_id = "zer0int/LongCLIP-GmP-ViT-L-14"
53
- config = CLIPConfig.from_pretrained(model_id)
54
- if clipmodel == "norm":
55
- model_id = "zer0int/CLIP-GmP-ViT-L-14"
56
- config = CLIPConfig.from_pretrained(model_id)
57
- clip_model = CLIPModel.from_pretrained(model_id, torch_dtype=torch.bfloat16, config=config, ignore_mismatched_sizes=False).to("cuda")
58
- clip_processor = CLIPProcessor.from_pretrained(model_id, padding="max_length", ignore_mismatched_sizes=False, return_tensors="pt", truncation=True)
59
- pipe.tokenizer = clip_processor.tokenizer
60
- pipe.text_encoder = clip_model.text_model
61
- pipe.text_encoder.dtype = torch.bfloat16
62
  torch.cuda.empty_cache()
63
 
64
  MAX_SEED = 2**32-1
 
47
  pipe.vae = AutoencoderTiny.from_pretrained("madebyollin/taef1", torch_dtype=dtype).to("cuda")
48
 
49
  pipe.to("cuda")
50
+ #clipmodel = 'norm'
51
+ #if clipmodel == "long":
52
+ # model_id = "zer0int/LongCLIP-GmP-ViT-L-14"
53
+ # config = CLIPConfig.from_pretrained(model_id)
54
+ #if clipmodel == "norm":
55
+ # model_id = "zer0int/CLIP-GmP-ViT-L-14"
56
+ # config = CLIPConfig.from_pretrained(model_id)
57
+ #clip_model = CLIPModel.from_pretrained(model_id, torch_dtype=torch.bfloat16, config=config, ignore_mismatched_sizes=False).to("cuda")
58
+ #clip_processor = CLIPProcessor.from_pretrained(model_id, padding="max_length", ignore_mismatched_sizes=False, return_tensors="pt", truncation=True)
59
+ #pipe.tokenizer = clip_processor.tokenizer
60
+ #pipe.text_encoder = clip_model.text_model
61
+ #pipe.text_encoder.dtype = torch.bfloat16
62
  torch.cuda.empty_cache()
63
 
64
  MAX_SEED = 2**32-1