File size: 1,944 Bytes
dd50a90
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
from gradio_client import Client, file
import os 
token = os.getenv('HF_TOKEN')
client = Client("K00B404/HugChatWrap", hf_token=token)

def generate(style="dragon themed",x_imgs=3):
    client.predict(
      api_name="/_pop_last_user_message"
    )
    
    client.predict(
      api_name="/lambda_6"
    )
    
    client.predict(
      api_name="/_append_message_to_history_1"
    )
    
    client.predict(
      api_name="/lambda_2"
    )
    
    client.predict(
      param_2=None,
      param_3=None,
      param_4=You are a expert prompt engineer, and specialize in visual description prompts for image generation models.,
      param_5=2048,
      api_name="/_stream_fn_1"
    )
    
    client.predict(
      api_name="/lambda_8"
    )
    
    img_list=client.predict(
      x=[f"""make a python list of {x_imgs} visual descriptions as prompts for a image generation model, inspired by [{style}] , 
      make sure the prompts are ramdom , eleborate, and describe mindblowing details.
      example response:
      [
          'In a realm of shimmering quartz crystal veins, a mythical phoenix soars amidst the cosmic dance of constellations, its plumage a dazzling display of hues that defy imagination.',
          'A breathtaking panorama of a snow-capped mountain range, where ancient glaciers have carved out a landscape of icy wonder, their pristine whiteness beckoning to the keen eye.',
          'A kaleidoscope of color, as a living tapestry of bioluminescent algae unfolds across the surface of a deep-sea vortex, their soft glow illuminating the surrounding darkness in a mesmerizing display of nature's grand spectacle.'
      ]
      """],
      api_name="/lambda_3"
    )
    
    client.predict(
      api_name="/lambda_4"
    )
    
    client.predict(
      saved_conversations=None,
      api_name="/_save_conversation_1"
    )
    return img_list

if __name__ == '__main__':
    print(generate("dragon themed",3))