@@ -70,6 +70,12 @@ function get_base_diffusers_model(model: ModelData): string {
70
70
return model . cardData ?. base_model ?. toString ( ) ?? "fill-in-base-model" ;
71
71
}
72
72
73
+ function get_prompt_from_diffusers_model ( model : ModelData ) : string {
74
+ return model . cardData ?. widget ?. [ 0 ] ?. text ?. toString ( )
75
+ ?? model . cardData ?. instance_prompt ?. toString ( )
76
+ ?? "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" ;
77
+ }
78
+
73
79
export const bertopic = ( model : ModelData ) : string [ ] => [
74
80
`from bertopic import BERTopic
75
81
@@ -134,7 +140,7 @@ const diffusers_default = (model: ModelData) => [
134
140
135
141
pipe = DiffusionPipeline.from_pretrained("${ model . id } ")
136
142
137
- prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k "
143
+ prompt = "${ get_prompt_from_diffusers_model ( model ) } "
138
144
image = pipe(prompt).images[0]` ,
139
145
] ;
140
146
@@ -153,7 +159,7 @@ const diffusers_lora = (model: ModelData) => [
153
159
pipe = DiffusionPipeline.from_pretrained("${ get_base_diffusers_model ( model ) } ")
154
160
pipe.load_lora_weights("${ model . id } ")
155
161
156
- prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k "
162
+ prompt = "${ get_prompt_from_diffusers_model ( model ) } "
157
163
image = pipe(prompt).images[0]` ,
158
164
] ;
159
165
0 commit comments