vibs08 commited on
Commit
9057c2e
·
verified ·
1 Parent(s): 34bae05

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -7
app.py CHANGED
@@ -16,12 +16,6 @@ from PIL import Image
16
  from functools import partial
17
  import io
18
 
19
- # s3 = boto3.client(
20
- # 's3',
21
- # aws_access_key_id="AKIAZW3QSPMIH4RF42UA",
22
- # aws_secret_access_key="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",
23
- # region_name='us-east-1'
24
- # )
25
 
26
  subprocess.run(shlex.split('pip install wheel/torchmcubes-0.1.0-cp310-cp310-linux_x86_64.whl'))
27
 
@@ -45,10 +39,12 @@ model.renderer.set_chunk_size(131072)
45
  model.to(device)
46
 
47
  rembg_session = rembg.new_session()
 
 
 
48
 
49
  def generate_image_from_text(pos_prompt):
50
  # bedrock_runtime = boto3.client(region_name = 'us-east-1', service_name='bedrock-runtime')
51
- bedrock_runtime = boto3.client(service_name='bedrock-runtime', aws_access_key_id = "AKIAZW3QSPMIH4RF42UA", aws_secret_access_key = "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", region_name='us-east-1')
52
  parameters = {'text_prompts': [{'text': pos_prompt , 'weight':1},
53
  {'text': """Blurry, out of frame, out of focus, Detailed, dull, duplicate, bad quality, low resolution, cropped""", 'weight': -1}],
54
  'cfg_scale': 7, 'seed': 0, 'samples': 1}
 
16
  from functools import partial
17
  import io
18
 
 
 
 
 
 
 
19
 
20
  subprocess.run(shlex.split('pip install wheel/torchmcubes-0.1.0-cp310-cp310-linux_x86_64.whl'))
21
 
 
39
  model.to(device)
40
 
41
  rembg_session = rembg.new_session()
42
+ my_aws_access_key_id = os.getenv("ACCESS")
43
+ my_aws_secret_access_key = os.getenv("SECRET")
44
+ bedrock_runtime = boto3.client(service_name='bedrock-runtime', aws_access_key_id = my_aws_access_key_id, aws_secret_access_key = my_aws_secret_access_key, region_name='us-east-1')
45
 
46
  def generate_image_from_text(pos_prompt):
47
  # bedrock_runtime = boto3.client(region_name = 'us-east-1', service_name='bedrock-runtime')
 
48
  parameters = {'text_prompts': [{'text': pos_prompt , 'weight':1},
49
  {'text': """Blurry, out of frame, out of focus, Detailed, dull, duplicate, bad quality, low resolution, cropped""", 'weight': -1}],
50
  'cfg_scale': 7, 'seed': 0, 'samples': 1}