pranavajay commited on
Commit
1251cec
·
verified ·
1 Parent(s): aa8cfff

Update api.py

Browse files
Files changed (1) hide show
  1. api.py +4 -4
api.py CHANGED
@@ -79,15 +79,15 @@ def generate_random_sequence():
79
  return f"{random_numbers}_{random_words}"
80
 
81
  # Load the default pipeline once globally for efficiency
82
- flux_pipe = FluxPipeline.from_pretrained("trongg/Flux-Dev2Pro_nsfw_fluxtastic-v3", torch_dtype=torch.bfloat16)
83
  flux_pipe.enable_model_cpu_offload()
84
  logging.info("FluxPipeline loaded successfully.")
85
 
86
- img_pipe = FluxImg2ImgPipeline.from_pretrained("trongg/Flux-Dev2Pro_nsfw_fluxtastic-v3", torch_dtype=torch.bfloat16)
87
  img_pipe.enable_model_cpu_offload()
88
  logging.info("FluxImg2ImgPipeline loaded successfully.")
89
 
90
- inpainting_pipe = FluxInpaintPipeline.from_pretrained("trongg/Flux-Dev2Pro_nsfw_fluxtastic-v3", torch_dtype=torch.bfloat16)
91
  inpainting_pipe.enable_model_cpu_offload()
92
  logging.info("FluxInpaintPipeline loaded successfully.")
93
 
@@ -157,7 +157,7 @@ async def set_controlnet_adapter(adapter: str, is_inpainting: bool = False):
157
  controlnet = FluxControlNetModel.from_pretrained(controlnet_model_path, torch_dtype=torch.bfloat16)
158
  pipeline_cls = FluxControlNetPipeline if not is_inpainting else FluxControlNetInpaintPipeline
159
  flux_controlnet_pipe = pipeline_cls.from_pretrained(
160
- "trongg/Flux-Dev2Pro_nsfw_fluxtastic-v3", controlnet=controlnet, torch_dtype=torch.bfloat16
161
  )
162
  flux_controlnet_pipe.to("cuda")
163
  logging.info(f"ControlNet adapter '{adapter}' loaded successfully.")
 
79
  return f"{random_numbers}_{random_words}"
80
 
81
  # Load the default pipeline once globally for efficiency
82
+ flux_pipe = FluxPipeline.from_pretrained("pranavajay/flow", torch_dtype=torch.bfloat16)
83
  flux_pipe.enable_model_cpu_offload()
84
  logging.info("FluxPipeline loaded successfully.")
85
 
86
+ img_pipe = FluxImg2ImgPipeline.from_pretrained("pranavajay/flow", torch_dtype=torch.bfloat16)
87
  img_pipe.enable_model_cpu_offload()
88
  logging.info("FluxImg2ImgPipeline loaded successfully.")
89
 
90
+ inpainting_pipe = FluxImg2ImgPipeline.from_pretrained("pranavajay/flow", torch_dtype=torch.bfloat16)
91
  inpainting_pipe.enable_model_cpu_offload()
92
  logging.info("FluxInpaintPipeline loaded successfully.")
93
 
 
157
  controlnet = FluxControlNetModel.from_pretrained(controlnet_model_path, torch_dtype=torch.bfloat16)
158
  pipeline_cls = FluxControlNetPipeline if not is_inpainting else FluxControlNetInpaintPipeline
159
  flux_controlnet_pipe = pipeline_cls.from_pretrained(
160
+ "pranavajay/flow", controlnet=controlnet, torch_dtype=torch.bfloat16
161
  )
162
  flux_controlnet_pipe.to("cuda")
163
  logging.info(f"ControlNet adapter '{adapter}' loaded successfully.")