John6666 commited on
Commit
b1fa480
β€’
1 Parent(s): 940c34b

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -38,8 +38,6 @@ good_vae = AutoencoderKL.from_pretrained(base_model, subfolder="vae", torch_dtyp
38
  pipe = DiffusionPipeline.from_pretrained(base_model, torch_dtype=dtype, vae=taef1).to(device)
39
  controlnet_union = None
40
  controlnet = None
41
- controlnet_union = FluxControlNetModel.from_pretrained(controlnet_model_union_repo, torch_dtype=dtype).to(device)
42
- controlnet = FluxMultiControlNetModel([controlnet_union]).to(device)
43
  last_model = models[0]
44
  last_cn_on = False
45
 
@@ -62,8 +60,8 @@ def change_base_model(repo_id: str, cn_on: bool): # , progress=gr.Progress(track
62
  #progress(0, desc=f"Loading model: {repo_id} / Loading ControlNet: {controlnet_model_union_repo}")
63
  print(f"Loading model: {repo_id} / Loading ControlNet: {controlnet_model_union_repo}")
64
  #clear_cache()
65
- #controlnet_union = FluxControlNetModel.from_pretrained(controlnet_model_union_repo, torch_dtype=dtype).to(device)
66
- #controlnet = FluxMultiControlNetModel([controlnet_union]).to(device)
67
  pipe = FluxControlNetPipeline.from_pretrained(repo_id, controlnet=controlnet, torch_dtype=dtype)#.to(device)
68
  #pipe.flux_pipe_call_that_returns_an_iterable_of_images = flux_pipe_call_that_returns_an_iterable_of_images.__get__(pipe)
69
  last_model = repo_id
 
38
  pipe = DiffusionPipeline.from_pretrained(base_model, torch_dtype=dtype, vae=taef1).to(device)
39
  controlnet_union = None
40
  controlnet = None
 
 
41
  last_model = models[0]
42
  last_cn_on = False
43
 
 
60
  #progress(0, desc=f"Loading model: {repo_id} / Loading ControlNet: {controlnet_model_union_repo}")
61
  print(f"Loading model: {repo_id} / Loading ControlNet: {controlnet_model_union_repo}")
62
  #clear_cache()
63
+ controlnet_union = FluxControlNetModel.from_pretrained(controlnet_model_union_repo, torch_dtype=dtype)#.to(device)
64
+ controlnet = FluxMultiControlNetModel([controlnet_union])#.to(device)
65
  pipe = FluxControlNetPipeline.from_pretrained(repo_id, controlnet=controlnet, torch_dtype=dtype)#.to(device)
66
  #pipe.flux_pipe_call_that_returns_an_iterable_of_images = flux_pipe_call_that_returns_an_iterable_of_images.__get__(pipe)
67
  last_model = repo_id