K00B404 commited on
Commit
c4508a9
·
verified ·
1 Parent(s): 441dace

Update Flux.py

Browse files
Files changed (1) hide show
  1. Flux.py +4 -3
Flux.py CHANGED
@@ -3,13 +3,13 @@ from gradio_client import Client
3
 
4
  token=os.getenv('HF_WRITE_TOKEN')
5
 
6
- class capacitor:
7
  def __init__(self, client="K00B404/FluxCapacitor" ):
8
  self.token = token
9
  self.client = Client(client, hf_token=self.token)
10
 
11
 
12
- def generate(self prompt,neg=None, steps=35,cfg_scale=7,sampler="DPM++ 2M Karras",seed=-1,strength=0.7,use_dev=False,enhance_prompt_style="Hello!!",enhance_prompt_option=False,nemo_enhance_prompt_style="Hello!!",use_mistral_nemo=False,):
13
  img_path,seed,used_prompt = client.predict(
14
  prompt=prompt,
15
  is_negative="(deformed, distorted, disfigured), poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, (mutated hands and fingers), disconnected limbs, mutation, mutated, ugly, disgusting, blurry, amputation, misspellings, typos" if not neg else neg,
@@ -27,4 +27,5 @@ class capacitor:
27
  api_name="/query"
28
  )
29
  print(img_path,seed,used_prompt )
30
- return img_path,seed,used_prompt
 
 
3
 
4
  token=os.getenv('HF_WRITE_TOKEN')
5
 
6
+ class Capacitor:
7
  def __init__(self, client="K00B404/FluxCapacitor" ):
8
  self.token = token
9
  self.client = Client(client, hf_token=self.token)
10
 
11
 
12
+ def generate(self, prompt, neg=None, steps=35,cfg_scale=7,sampler="DPM++ 2M Karras",seed=-1,strength=0.7,use_dev=False,enhance_prompt_style="Hello!!",enhance_prompt_option=False,nemo_enhance_prompt_style="Hello!!",use_mistral_nemo=False,):
13
  img_path,seed,used_prompt = client.predict(
14
  prompt=prompt,
15
  is_negative="(deformed, distorted, disfigured), poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, (mutated hands and fingers), disconnected limbs, mutation, mutated, ugly, disgusting, blurry, amputation, misspellings, typos" if not neg else neg,
 
27
  api_name="/query"
28
  )
29
  print(img_path,seed,used_prompt )
30
+ return img_path,seed,used_prompt
31
+